Click to See Complete Forum and Search --> : Need Java Help


Grub
06-04-2004, 11:33 AM
I'm relatively new to Linux -- I'm using FC2 btw. I am trying to run PCGen on my system, but I've had problems with the .jar files. When typing in java -jar pcgen.jar, I get this error:

java: command not found

Did some digging and found out that I need to make a PATH to java (I admit this is somewhat confusing). Anyway, I enter this command as su:

export PATH=$PATH:/usr/java/j2re1.4.2_04/bin

Then when I type java -version, I get this:
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)

Looking good. I can even run PCGen now.

BUT...

when I exit the command line, and again try to find java by typing java -version, I get the old error:

java: command not found

How do I make the export permanent? Sorry if I'm asking this question incorrectly, but I'd like to do the export just once, and then run .jar files when I need to.

Please advise.

Regards

JayMan8081
06-04-2004, 11:41 AM
If you are using bash as your shell add export PATH=$PATH:/usr/java/j2re1.4.2_04/bin to the .bashrc file in your user's home directory.

ph34r
06-04-2004, 11:42 AM
Put your "export PATH" statement in /etc/profile.

Also, add "export JAVA_HOME=/usr/java/j2re1.4.2_04" in there as well.

CaptainPinko
06-04-2004, 11:44 AM
or - using my perferred method - link all your java executables (eg java, java, javadoc) to /usr/bin. I find mucking with my path to be an ugly solution.

Grub
06-04-2004, 11:55 AM
Thanks very much everyone for the help! JayMan's solution worked perfect for me.

...now if I can only create an executable launcher button in Gnome for PCGen for my desktop. :)