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 09-21-2003, 08:42 AM   #1
brutal_brad
LQ Newbie
 
Registered: Sep 2003
Posts: 24

Rep: Reputation: 15
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
 
Old 09-21-2003, 08:54 AM   #2
MiscGeek
Member
 
Registered: Jan 2003
Location: Georgia, US
Distribution: RHEL WS4
Posts: 189

Rep: Reputation: 30
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
 
Old 09-21-2003, 09:01 AM   #3
brutal_brad
LQ Newbie
 
Registered: Sep 2003
Posts: 24

Original Poster
Rep: Reputation: 15
I don't have a /usr/java directory - perhaps it hasn't been set up properly on my computer
 
Old 09-21-2003, 09:31 AM   #4
MiscGeek
Member
 
Registered: Jan 2003
Location: Georgia, US
Distribution: RHEL WS4
Posts: 189

Rep: Reputation: 30
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
 
Old 09-21-2003, 09:59 AM   #5
brutal_brad
LQ Newbie
 
Registered: Sep 2003
Posts: 24

Original Poster
Rep: Reputation: 15
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
 
Old 09-21-2003, 10:53 AM   #6
MiscGeek
Member
 
Registered: Jan 2003
Location: Georgia, US
Distribution: RHEL WS4
Posts: 189

Rep: Reputation: 30
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.
 
Old 09-21-2003, 11:01 AM   #7
brutal_brad
LQ Newbie
 
Registered: Sep 2003
Posts: 24

Original Poster
Rep: Reputation: 15
yeah it is corrupted - just realised. Oh well download it again which is fun with my 56k modem. Thanks for your help
 
Old 09-21-2003, 02:52 PM   #8
MiscGeek
Member
 
Registered: Jan 2003
Location: Georgia, US
Distribution: RHEL WS4
Posts: 189

Rep: Reputation: 30
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
 
  


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
Setting up my java classpath in redhat working2hard Programming 9 07-28-2004 10:15 AM
setting classpath for java in mdk9.2 perryub Linux - Newbie 2 05-07-2004 04:02 PM
How to set classpath for java jolly Linux - Software 3 04-22-2003 10:02 PM
setting CLASSPATH variable gabadoo Linux - Newbie 7 01-21-2002 04:24 PM
ClASSPATH variable for Java oulevon Linux - General 1 02-28-2001 08:25 PM


All times are GMT -5. The time now is 08:51 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration