LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-08-2011, 12:07 PM   #1
karavella11
LQ Newbie
 
Registered: Feb 2011
Posts: 6

Rep: Reputation: 0
Java command not found


Hi

I want to run java -jar command and I have the following :
command not found

What I need to do?
 
Old 02-08-2011, 12:12 PM   #2
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,088

Rep: Reputation: 196Reputation: 196
Which command isn't being found, java or the command you're trying to run?

Please post exactly what you are typing and exactly what appears after you type it. Use copy/paste and wrap everything in code tags to make it readable.
 
Old 02-08-2011, 01:08 PM   #3
karavella11
LQ Newbie
 
Registered: Feb 2011
Posts: 6

Original Poster
Rep: Reputation: 0
I want to run .jar file
So I am using " java -jar <filename>" command to execute the java file
It gaves me an error - Command not found
I tried to make "java ?" , also - Command not found
 
Old 02-08-2011, 01:11 PM   #4
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,088

Rep: Reputation: 196Reputation: 196
Type this at a command prompt

Code:
$ which java
Post the output.
 
Old 02-08-2011, 01:14 PM   #5
karavella11
LQ Newbie
 
Registered: Feb 2011
Posts: 6

Original Poster
Rep: Reputation: 0
/usr/bin/which: no java in (/usr/local/bin:/use/bin:/bin:/use/local/sbin:/usr/sbin:/svbin:/home/student/bin)
 
Old 02-08-2011, 01:15 PM   #6
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,088

Rep: Reputation: 196Reputation: 196
Then you need to install java. If you don't know how to do that post which version of Linux you are using.
 
Old 02-08-2011, 01:16 PM   #7
karavella11
LQ Newbie
 
Registered: Feb 2011
Posts: 6

Original Poster
Rep: Reputation: 0
Yes I dont know how to do it
I have Fedora 14 - i686
 
Old 02-08-2011, 01:26 PM   #8
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,088

Rep: Reputation: 196Reputation: 196
Look in the menus under System → Administration and you should see an entry called 'Add/Remove Software'. Run that and search for Java. Select it and install.

Alternatively I think typing this at a command prompt will work but I don't have access to a computer running Fedora to check.
Code:
$ sudo yum install java
Or if not that then maybe this
Code:
$ su -
$ yum install java
You'll need to enter the root password when su asks you for it.
 
Old 02-08-2011, 01:37 PM   #9
karavella11
LQ Newbie
 
Registered: Feb 2011
Posts: 6

Original Poster
Rep: Reputation: 0
I cant do both ways

First I cant see anything in Add/Remove list something just about Java

Second, the commands give me next:

Error: Cannot retrieve repository metadata (repomd.xml) for repository: fedora.
Please verify its path and try again

=(
 
Old 02-08-2011, 01:40 PM   #10
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,281

Rep: Reputation: 3164Reputation: 3164Reputation: 3164Reputation: 3164Reputation: 3164Reputation: 3164Reputation: 3164Reputation: 3164Reputation: 3164Reputation: 3164Reputation: 3164
# yum install java : I'd say no to the gcj java.

Installing the genuine sun-java-jdk :
http://www.if-not-true-then-false.co...-red-hat-rhel/

..
 
Old 02-08-2011, 02:18 PM   #11
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,088

Rep: Reputation: 196Reputation: 196
So it looks like your computer is having some sort of problem with retrieving the information from the repositories and that is going to prevent you installing Java.

Does the computer have Internet access?



Copy and paste can be done by selecting the text on the screen, right clicking and then selecting Copy. Then go to the window where you're composing your post and right click and select Paste.

Code tags can be created by selecting text in your post and then clicking the icon in the toolbar that look like #


Seriously, learn to use these for when you want to post the output of commands. It is much, much, better than you retyping what you can see.
 
Old 02-09-2011, 06:15 AM   #12
karavella11
LQ Newbie
 
Registered: Feb 2011
Posts: 6

Original Poster
Rep: Reputation: 0
Hi

I already solved the issue by downloading the Java rpm package, and installing it
For the snapshots, my Linux machine don't have Internet access, so I am using another one.

Anyway , thx for help !
 
Old 02-09-2011, 06:26 AM   #13
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,088

Rep: Reputation: 196Reputation: 196
Quote:
Originally Posted by karavella11 View Post
For the snapshots, my Linux machine don't have Internet access
Well if the computer doesn't have Interenet access you're not going to be able install anything from the repositories.
 
  


Reply


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
java -version, bash: java: command not found kirman Programming 4 03-19-2008 11:13 PM
java command not found???? haora Linux - Newbie 3 03-30-2005 10:27 AM
java:command not found allendefall Linux - Software 1 12-24-2004 01:57 AM
java: command not found inteliblake Linux - Software 4 10-10-2003 08:56 PM
command java not found?! weeboab Linux - Software 15 08-24-2003 06:52 AM


All times are GMT -5. The time now is 10:22 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration