i'm lost with Java home
hi there, i'm trying to install a program with java ... i think
i'm running centOS and i have install java by yum yum install java* i'm pretty sure i have java this is what i get wheni run locate. [root@centos html]# locate bin/java /usr/sbin/javaconfig /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/bin/java /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javadoc /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/java /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javah /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/bin/javac /usr/bin/javadoc /usr/bin/java /usr/bin/javah /usr/bin/javac this is the command the readme tells me to run [root@centos html]# java -jar VirusHammer.jar Warning: -jar not understood. Ignoring. Exception in thread "main" java.lang.NoClassDefFoundError: VirusHammer.jar at gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.5.0.0) at _Jv_ThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.5.0.0) at _Jv_RunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/libgcj.so.5.0.0) at __gcj_personality_v0 (/var/www/html/java.version=1.4.2) at __libc_start_main (/lib/tls/libc-2.3.4.so) at _Jv_RegisterClasses (/var/www/html/java.version=1.4.2) this is what i get when I run which java [root@centos html]# which java /usr/bin/java i'm run the following commands in the hope that it will fix it [root@centos html]# export JAVA_HOME=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/bin/java [root@centos html]# echo $JAVA_HOME /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/bin/java Still nothing, help me please ... |
Try executing:
Code:
java -? Also, $JAVA_HOME shouldn't point to the "java" program, but rather to the directory where you installed the Java JDK or JRE. In your case, set it as follows: export JAVA_HOME=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/. |
JAVA_HOME needs to point to a directory where you installed Java JDK or JRE, not to the "java" program.
So, $JAVA_HOME/bin/java is the location of the java program. In other words, do: Code:
export JAVA_HOME=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/ Or Code:
export JAVA_HOME=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/ Also, run Code:
java -? And finally, as "which java" indicates, the /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/bin/java isn't used, but /usr/bin/java instead. Can you do an "ls -l /usr/bin/java " to see if it's a symbolic link to another program? |
okay timmeke thanks all that information is very helpful.
using the command ls -l /usr/bin/java i found out that it is a like to the alternatives configuration and i've already set alternatives --config java. i ran the command Quote:
and Quote:
but each time i got the same error message |
http://www.centos.org/modules/newbb/...=2475&forum=28
seems to deal with your problem. |
All times are GMT -5. The time now is 12:57 AM. |