LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-06-2006, 04:53 AM   #1
paul_mat
Member
 
Registered: Nov 2004
Location: Townsville, Australia
Distribution: Fedora Core 5, CentOS 4, RHEL 4
Posts: 855

Rep: Reputation: 30
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 ...
 
Old 04-06-2006, 05:14 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Try executing:
Code:
java -?
to see what options your java program supports.

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/.
 
Old 04-06-2006, 05:18 AM   #3
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
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/
if you only installed the jre.
Or
Code:
export JAVA_HOME=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/
if you have the full JDK.

Also, run
Code:
 java -?
to get a list of options for "java" and see if there's a "-jar" option.

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?
 
Old 04-06-2006, 05:37 AM   #4
paul_mat
Member
 
Registered: Nov 2004
Location: Townsville, Australia
Distribution: Fedora Core 5, CentOS 4, RHEL 4
Posts: 855

Original Poster
Rep: Reputation: 30
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:
export JAVA_HOME=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/
and tried to isntall my program

and

Quote:
export JAVA_HOME=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/
and tried to install it again

but each time i got the same error message
 
Old 04-06-2006, 09:05 AM   #5
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
http://www.centos.org/modules/newbb/...=2475&forum=28
seems to deal with your problem.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Lost my home directory in fedora core 4 sudharani Linux - General 1 03-11-2006 08:37 AM
lost root to home machine mjl3434 Linux - Security 3 02-11-2006 05:09 AM
lost~ indicating home dir JesseMor Slackware 6 01-29-2006 04:49 PM
contents of /home lost! skvasistha Linux - Software 2 11-23-2004 05:31 AM
Really lost in setting up home network webwolf70 Mandriva 2 09-22-2004 04:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration