LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   setting java classpath... (https://www.linuxquestions.org/questions/linux-newbie-8/setting-java-classpath-95120/)

brutal_brad 09-21-2003 08:42 AM

setting java classpath...
 
I'm using red-hat 9.0 on a laptop.2 things:

How do I set the Java classpath variable in linux?
Where do I need to set it to?

I've downloaded the latest jdk (j2sdk-1_4_2_01-linux-i586-rpm) and executed the file but I don't know where it has put the required java files. I really don't have a clue when it comes to linux I'm afraid!

Thanks for any help

MiscGeek 09-21-2003 08:54 AM

Look in your /usr/java/ directory. You should see a directory called j2sdk1.4.2 or something similar.

I'm not sure what you mean by setting the classpath. You would usually want to set that when you run a java app. Java will automatically load the runtime jars for when it's started.

On the off chance your asking about adding the java binary to your path, you have two choices.

1. Add $PATH=$PATH:/<fullpathtojdk>/bin to your /etc/profile if you want java available to all users.

2. Add $PATH=$PATH:/<fullpathtojdk>/bin to your $HOME/.bashrc if you only want java available to you.

Mike

brutal_brad 09-21-2003 09:01 AM

I don't have a /usr/java directory - perhaps it hasn't been set up properly on my computer

MiscGeek 09-21-2003 09:31 AM

How did you install the rpm?

To install rpms you have to run, as root, rpm -Uvh <name_of_rpm>. In your case this would be rpm -Uvh j2sdk-1_4_2_01-linux-i586-rpm.

If I remember correctly Sun distributes a .bin file that you have to run and agree to the license. This will extract the rpm. You then have to install the rpm using the above instructions.

Mike

brutal_brad 09-21-2003 09:59 AM

I have run the .bin file and agreed to the license. I don't know where it extracts the rpm to though. Any ideas? It isn't the same directory

MiscGeek 09-21-2003 10:53 AM

That's odd :( It extracted to the same directory when I ran it. Did you notice any error messages right after agreeing to license? It's possible that the file was corrupted during the download.

Might want to download it again.

brutal_brad 09-21-2003 11:01 AM

yeah it is corrupted - just realised. Oh well download it again which is fun with my 56k modem. Thanks for your help

MiscGeek 09-21-2003 02:52 PM

Quote:

Originally posted by brutal_brad
yeah it is corrupted - just realised. Oh well download it again which is fun with my 56k modem. Thanks for your help
Ouch..., that can be painful :( You're quite welcome.

Mike


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