LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Java SDK help! (https://www.linuxquestions.org/questions/linux-software-2/java-sdk-help-331950/)

nr5 06-09-2005 02:41 PM

Java SDK help!
 
Hello,

Just installed Java SDK (on Fedora Core 3) using the Self-Extracting Binary into /usr/local/java....
Problem is when I type "java" or "javac" on the commandline i get:

# java
bash: java: command not found
# javac
bash: javac: command not found

Not sure what to do..? If I need to add something to a file or something, please explain how (for I am a newbie on linux).

Thank you.

Komakino 06-09-2005 02:46 PM

You need to add /usr/local/java/bin to the path.
You can do that either in ~/.bashrc or globally in /etc/profile

dosnlinux 06-09-2005 03:52 PM

or you could link the java binaries to ones in /usr/local/bin

nr5 06-09-2005 04:16 PM

Quote:

You can do that either in ~/.bashrc or globally in /etc/profile
Just had a look at /etc/profile and ~/.bashrc and Im not sure how to add anything in there... all i see is code "if..."...

Quote:

or you could link the java binaries to ones in /usr/local/bin
How is that done? :)


Thx.

Komakino 06-09-2005 04:33 PM

In /etc/profile find the bit that says:

PATH=...

and inside the inverted commas, add /usr/local/java/bin in exactly the same manner as all the other directories.

Changes take effect either when you log in again, or by typing:
source /etc/profile at a terminal window before trying something java related.

dosnlinux 06-10-2005 08:33 AM

Quote:

Originally posted by nr5
or you could link the java binaries to ones in /usr/local/bin


How is that done? :)


Thx. [/B]
Code:

ln -s /javabinarypathandfilename /usr/local/bin/javabinaryfilename
I have noticed that trying to do this with a couple of java programs gives errors about missing files so you might have to make a shell script for each individual file:rolleyes:

to do this open a text editor and type the full file path (ex. /usr/bin/javac) save the file as /usr/local/bin/progname and give it 755 permissions.

Try the first way, and if it doesn't work right changing you path might be easier, but it's up to you whatever you decide to do.;)


All times are GMT -5. The time now is 02:06 PM.