LinuxQuestions.org
Review your favorite Linux distribution.
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
 
LinkBack Search this Thread
Old 08-01-2010, 06:57 AM   #1
mr_anderson
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Rep: Reputation: 0
bash: java: command not found help please


Hi
I am new to Linux, I installed RH5, and netbeans 6.9 in addition to JDK 6.1 (I used the RPM to install both of them.
when I tried to run a jar file i got:
"Failed to load Main-Class manifest attribute from jedit42install.jar"
when I used this command: "java -version"
the result was:
java version "1.4.2"
I searched via google and found that I should install an updated JRE so I installed this one "jre-6u21-linux-i586-rpm.bin" from sun.
the problem is now that when I run the "java -version" command I get:
"bash: java: command not found"
can you help me please.
Note: I used RPM to install Netbeans ,JDK and JRE so I donot know where are they on my system, now how can I find their locations and how can I solve this problem.
Regards.
Anderson.
 
Old 08-01-2010, 07:44 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2010.12, Slack1337 DebSqueeze, +50+ other Linux OS, for test only.
Posts: 9,302

Rep: Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353
Welcome to LQ. .. .. ..

Probably like this
1) su
2)
Code:
/usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_21/bin/java 2
( /usr/sbin/alternatives --install /usr/bin/javac javac /usr/java/jdk1.6.0_21/bin/javac 2 )
3) /usr/sbin/alternatives --config java
(( 4) /usr/sbin/alternatives --config javac ))
..


'rpm -ql <package-name>' : Will show the file locations.
You can get the valid package name with , example : rpm -qa | grep jdk

..

Last edited by knudfl; 08-01-2010 at 08:06 AM.
 
Old 08-01-2010, 01:33 PM   #3
mr_anderson
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Hi Knudfl
Thank you very much I used your commands and located the jre when I issue this command:
/usr/java/jre1.6.0_21/bin/java -jar test.jar
I get the same message which is:
"Failed to load Main-Class manifest attribute from test.jar"
what do you suggest now ?
By the way I used your command to regarding steps 1 to 4 and now when I issue the "java -version" I get:
"java version 1.6.0_21" but I still have the Main-Class Manifest problem.

Last edited by mr_anderson; 08-01-2010 at 01:42 PM.
 
Old 08-01-2010, 01:57 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2010.12, Slack1337 DebSqueeze, +50+ other Linux OS, for test only.
Posts: 9,302

Rep: Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353
Did you try : java -jar jedit42install.jar
( Or some other .jar file ) ?


May be the "test.jar" just doesn't work ? An old file ?

..
 
1 members found this post helpful.
Old 08-01-2010, 02:03 PM   #5
mr_anderson
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Hi
It worked, this was my first project on Netbeans Linux edition, I checked the project configuration and I found that the Main class was set to none I just set it manually to my class and re-build it and now it is working just fine.
Thank you again.
 
  


Reply

Tags
alternatives, jdk6


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
:bash java: command not found KuraShoko Linux - Newbie 4 07-26-2010 11:03 AM
java -version, bash: java: command not found kirman Programming 4 03-19-2008 11:13 PM
-bash: java: command not found vinbase Linux - Newbie 1 01-01-2008 05:52 PM
(Debian) bash: java: command not found pjpeter Linux - Newbie 3 09-25-2004 02:59 PM
bash: java: command not found pjpeter Programming 4 09-24-2004 03:02 PM


All times are GMT -5. The time now is 12:39 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration