Page 1 of 1

[SOLVED]Problem with java path

PostPosted: Oct 17th, '15, 11:45
by davidmageia
I would like to use Openrefine (whici is written in java).
The comand ./refine leads to :
Could not find the 'java' executable at '', are you sure your JAVA_HOME environment variable is pointing to a proper java installation?


Below is the part of the code in "refine" to see that I have a "path" problem :
Code: Select all
if [ "$JAVA_HOME" ] ; then
    JAVA="$JAVA_HOME/bin/java"
     
else
    JAVA="`which java 2> /dev/null`"
fi

if [ ! -x "$JAVA" ] ; then
    error "Could not find the 'java' executable at '$JAVA', are you sure your JAVA_HOME environment variable is pointing to a proper java installation?"
fi


In my usr/lib/jvm folder I have many "java" version installed : java ; java1.8 ; java jre 1.8...
But none of them is linked to the usr/bin or bin folder...

How can I solve this question properly ?

Re: Problem with java path

PostPosted: Oct 17th, '15, 15:22
by doktor5000
Please at least provide the output from your normal user of

Code: Select all
/sbin/alternatives --display java
echo $PATH $JAVA_HOME
which java
java -version

Re: Problem with java path

PostPosted: Oct 17th, '15, 15:39
by davidmageia
Here it is...
Code: Select all
[david@localhost ~]$ /sbin/alternatives --display java
No alternatives for java.
[david@localhost ~]$ echo $PATH $JAVA_HOME
/usr/local/bin:/usr/bin:/usr/local/games:/usr/games:/usr/lib64/qt4/bin:/usr/lib64/qt5/bin:/home/david/bin
[david@localhost ~]$ which java
which: no java in (/usr/local/bin:/usr/bin:/usr/local/games:/usr/games:/usr/lib64/qt4/bin:/usr/lib64/qt5/bin:/home/david/bin)
[david@localhost ~]$ java -version
bash: java : commande introuvable

Re: Problem with java path

PostPosted: Oct 17th, '15, 18:08
by doktor5000
davidmageia wrote:In my usr/lib/jvm folder I have many "java" version installed : java ; java1.8 ; java jre 1.8...
But none of them is linked to the usr/bin or bin folder...

How can I solve this question properly ?


Well, by installing at least one java version properly. Install at least java-1.8.0-openjdk from Mageia repos and then try again.

FWIW, how did you install what java exactly?

Re: Problem with java path

PostPosted: Oct 19th, '15, 22:23
by davidmageia
I uninstall java-1.8.0-openjdk.
Now in the usr/lib/jvm folder I have nothing...
I suppose that I have to reinstall java-1.8.0-openjdk ?

Re: Problem with java path

PostPosted: Oct 19th, '15, 23:00
by davidmageia
And it works well now !
Thank you for your help.

Re: Problem with java path

PostPosted: Oct 19th, '15, 23:03
by doktor5000
Yes, you should have at least one java runtime environment installed.