6

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.

enter image description here

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.
emax
  • 181

1 Answers1

4

If you installed java from ppa it sets JAVA_HOME locally in:

/etc/profile.d/jdk.sh

which is added to env on user login. You can edit this file or if you use etckeeper better way is to checkout this file to any version you require.

Amorphous
  • 135