LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-07-2004, 06:58 AM   #1
perryub
Member
 
Registered: Apr 2004
Location: Ontario, Canada
Distribution: Ubuntu Hoary
Posts: 45

Rep: Reputation: 15
setting classpath for java in mdk9.2


Hi, I just set up a mandrake 9.2 system after
migrating from windowsXP. I'm trying to install
a couple of programs with no success. The first
is Java - how can I set the classpath so that I
can run *.java files from any directory?
Everything works just fine if the *.java file is
in the same directory as javac, so I know it is
installed properly. I read the directions on
Sun's web site and it tells me how to edit files
for various shells, but not bash, which is what
mandrake uses.

I've got an awful lot of learning to do before I am as productive on linux as I am on XP...

Thanks,

Perry
 
Old 05-07-2004, 08:50 AM   #2
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
There are a couple of places to do this. You could do it in your /etc/profile file although this could get blown away if you change your distro. The other place to do it would be in your .bash_profile or .bashrc file in your home directory.

You need to do a couple of things. The most important is to add the Java bin directory to the PATH statement. That will allow you to run javac and java from any location. The second thing to do is add the Java directory itself to the CLASSPATH. You may need to create the CLASSPATH variable, but that is done in the same file as the PATH and uses the same syntax.
 
Old 05-07-2004, 05:02 PM   #3
perryub
Member
 
Registered: Apr 2004
Location: Ontario, Canada
Distribution: Ubuntu Hoary
Posts: 45

Original Poster
Rep: Reputation: 15
got it working - many thanks.

Perry
 
  


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 11:15 AM
setting java classpath... brutal_brad Linux - Newbie 7 09-21-2003 03:52 PM
How to set classpath for java jolly Linux - Software 3 04-22-2003 11:02 PM
setting CLASSPATH variable gabadoo Linux - Newbie 7 01-21-2002 05:24 PM
ClASSPATH variable for Java oulevon Linux - General 1 02-28-2001 09:25 PM


All times are GMT -5. The time now is 11:49 AM.

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