I am following this
How to set JAVA_HOME for Java?
in order to set the environment variable JAVA_HOME
to the correct version. I have different versions of java
in my /usr/lib/jvm/
folder as illustrated in the following picture.
I added JAVA_HOME="/usr/lib/jvm/java-8-oracle"
to the environment
file.
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
JAVA_HOME="/usr/lib/jvm/java-8-oracle"
export JAVA_HOME
however if I run google-refine
I have the following error:
./refine: 98: [: /tmp/refine.S4a2EGD: unexpected operator
Google Refine requires Java version 6 or later. If you have multiple versions of Java installed, please set the environment variable JAVA_HOME to the correct version.
java -version
andprintenv | grep JAVA_HOME
. If $JAVA_HOME gives nothing, you must add new PATH definition at end of these files:~/.bashrc
and~/.profile
– Redbob Sep 13 '17 at 13:36java -version
I havejava version "1.8.0_144" Java(TM) SE Runtime Environment (build 1.8.0_144-b01) Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
while afterprintenv | grep JAVA_HOME
I haveJAVA_HOME=/usr/lib/jvm/java-8-oracle
– emax Sep 13 '17 at 13:43sudo update-alternatives --display java
. Maybe Google-refine is not understanding your Default Java, or it will work better with JDK (you are running JRE). If the result of this command above is not as expected, visit this page to adjust your java environment – Redbob Sep 13 '17 at 14:00java - auto mode link best version is /usr/lib/jvm/java-8-oracle/jre/bin/java link currently points to /usr/lib/jvm/java-8-oracle/jre/bin/java link java is /usr/bin/java slave java.1.gz is /usr/share/man/man1/java.1.gz /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java - priority 1081 slave java.1.gz: /usr/lib/jvm/java-8-openjdk-amd64/jre/man/man1/java.1.gz /usr/lib/jvm/java-8-oracle/jre/bin/java - priority 1081 slave java.1.gz: /usr/lib/jvm/java-8-oracle/man/man1/java.1.gz
– emax Sep 13 '17 at 14:10export JAVA_HOME
is redundant./etc/environment
is not a script file. – Gunnar Hjalmarsson Sep 13 '17 at 16:18