Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 21st, 2002, 12:12 PM
Bikes Bikes is offline
Techie
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 13 Bikes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to Bikes
Talking Classpath

I downloaded the JDK and I cant get my java and javac to work. It keeps telling me 'command not found' even when I am in the bin directory. I am running RH Linux and tried setting the CLASSPATH in the sh shell by typing

CLASSPATH=the java home

export CLASSPATH

Well I dont know whot else to do. HELP!!

Reply With Quote
  #2  
Old October 21st, 2002, 12:20 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
You need to set the PATH variable, not the CLASSPATH (although you will need the classpath set later). From within the bin directory, did you type "java", or "./java". Red Hat doesn't include the current directory in the path by default.

**edit**
Also, you don't want to point the PATH or CLASSPATH to the root directory. The PATH needs to point to /bin, and the CLASSPATH needs to point to /lib.

Reply With Quote
  #3  
Old October 21st, 2002, 12:29 PM
Bikes Bikes is offline
Techie
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 13 Bikes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to Bikes
Unhappy

I did set the PATH, but it just doesnt stick.
When I restart the comp, it isnt there anymore

I used

PATH=

export PATH

Reply With Quote
  #4  
Old October 21st, 2002, 01:02 PM
Bikes Bikes is offline
Techie
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 13 Bikes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to Bikes
Quote:
Originally posted by bricker42
You need to set the PATH variable, not the CLASSPATH (although you will need the classpath set later). From within the bin directory, did you type "java", or "./java". Red Hat doesn't include the current directory in the path by default.

**edit**
Also, you don't want to point the PATH or CLASSPATH to the root directory. The PATH needs to point to /bin, and the CLASSPATH needs to point to /lib.


Ok, I fixed the PATH to point to javahome/bin and the java commands are running by editing the $PATH in .bash_profile. Do I have to do CLASSPATH? How do i make i stick?

Reply With Quote
  #5  
Old October 21st, 2002, 01:49 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
Look at the syntax in your .bash_profile for how the path is set. You should be able to copy that basic format for your classpath.

The problem with persistence that you're having is that when you log out all your environment variables are erased. You need to put commands into a script (.bash_profile) that is run every time you login.

Reply With Quote
  #6  
Old October 22nd, 2002, 11:21 AM
Bikes Bikes is offline
Techie
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 13 Bikes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to Bikes
Quote:
Originally posted by bricker42
Look at the syntax in your .bash_profile for how the path is set. You should be able to copy that basic format for your classpath.

The problem with persistence that you're having is that when you log out all your environment variables are erased. You need to put commands into a script (.bash_profile) that is run every time you login.



I pointed the the PATH to .bash_profile, I also set the CLASSPATH to bin. The commands are now working but I keep getting an error telling me that the package system does not exist.

Reply With Quote
  #7  
Old October 22nd, 2002, 11:41 AM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
http://java.sun.com/products/jdk/1....tml#Environment

That's for setting the path, right below it is the classpath. You're pointing to the wrong directories.

The instructions are for solaris, but they covers csh and bash, so they should work fine for you.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Classpath


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway