LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-17-2005, 03:53 AM   #16
sm1else
Member
 
Registered: Oct 2004
Distribution: At home: Ubuntu, Debian Sarge
Posts: 56

Rep: Reputation: 15

The problem as I understand it is that you have installed java but your shell doesnt know where to find it.

There are two main options if this is the problem.
The first and simplest is to modify the PATH environment variable
in bash:
Code:
export PATH=$JAVAPATH:$PATH
in tcsh:
Code:
setenv PATH $JAVAPATH:$PATH
Note that you need to replace $JAVAPATH in the above commands with the path to the bin directory in your java installation, i dont know where it will be on your machine but mine is "/usr/local/jdk1.5.0_02/bin"
On tcsh you will need to run
Code:
rehash
to be able to use the new commands.

The other alternative is to create symbolic links to the executables in a directory already in the PATH (such as /usr/local/bin) using something like:
Code:
ln -s $JAVAPATH/* /usr/local/bin/
Again replacing $JAVAPATH with the path to java's bin directory. With tcsh you will need to 'rehash' so that it finds the new commands.

The approach I prefer to use is to create a symbolic link called /usr/local/java which points to the directory java is installed to, and then use
Code:
ln -s /usr/local/java/bin/* /usr/local/bin/
to create links to java and javac in /usr/local/bin. The advantage to this approach is that when I update java, I only need to change the target of one link (/usr/local/java) and all my commands are updated to the new version.
 
  


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
basic java programming question nkoplm Programming 3 09-22-2005 01:37 AM
A very basic newbie question on Java lmellen Programming 5 07-19-2004 03:59 PM
2 Basic java questions.. Tru_Messiah Programming 6 05-16-2004 01:25 PM
Installing java...your basic newb ? Ogledbyoldmen Linux - Software 1 10-04-2003 10:44 PM
Visual Basic or Java figadiablo Programming 30 08-05-2003 10:52 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:58 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