Results 1 to 2 of 2
Hello, I have problems with setting my JAVA_HOME variable. I am using Slackware 12.0, bash shell. This is a question for the 'Linux Newbie' forum (not slackware-specific), and I have ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-10-2009 #1
- Join Date
- Sep 2008
Problems with setting the JAVA_HOME variable
I have problems with setting my JAVA_HOME variable. I am using Slackware 12.0, bash shell.
This is a question for the 'Linux Newbie' forum (not slackware-specific), and I have posted it there some hours ago, however, nobody is answering there to it, and I am still stuck with the problem.
I have set JAVA_HOME in my /etc/profile, like this:
but when I login in with my user name and type env on the command line, I get for JAVA_HOME the following:
Also, in my /etc/profile I have put the path to my java in the PATH variable, like this:
and when I type env when I login, then the PATH variable contains correctly the path to the jdk (as I have put it into /etc/profile).
I expect that after I have set everything as I want in /etc/profile, and restart the computer then what I have set will be relevant and when I login and type env, I will get values to the variables equal to those I have set in /etc/profile. Why it does not happen?
I have particularly a problem with a Java application, which I want to run. When I type ant, I get:
error: JAVA_HOME is not defined correctly.
We cannot execute /usr/lib/java/bin/java.
Thanks a lot.
- 01-11-2009 #2
i use java too. In /etc/profile you have a section
# # Make path more comfortable # if test -z "$PROFILEREAD" ; then PATH=/usr/local/bin:/usr/bin:/bin if test "$HOME" != "/" ; then for dir in $HOME/bin/$CPU $HOME/bin ; do test -d $dir && PATH=$dir:$PATH done fi if test "$UID" = 0 ; then test -d /opt/kde3/sbin && PATH=/opt/kde3/sbin:$PATH PATH=/sbin:/usr/sbin:/usr/local/sbin:$PATH fi for dir in /usr/X11/bin \ /usr/bin/X11 \ /usr/X11R6/bin \ /var/lib/dosemu \ /usr/games \ /opt/bin \ /opt/kde3/bin \ /opt/kde2/bin \ /opt/kde/bin \ /usr/openwin/bin \ /opt/cross/bin \ /usr/lib/jdk1.6.0_11/jre/bin do test -d $dir && PATH=$PATH:$dir done unset dir export PATH fi
Cheers!Registered Linux user #471256
Don`t give up so easy...