LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-01-2004, 09:50 PM   #1
antony_csf
Member
 
Registered: Jun 2004
Posts: 51

Rep: Reputation: 15
how to set java classpath on Redhat 9?


I am a newbie on Linux with java.

I would like to set the classpath so that all the user on linux can compile and run the java program anywhere!

also I would like to know how to make a executable jar file on linux!!

Thx !! newbie
 
Old 07-02-2004, 02:41 AM   #2
nedian123
Member
 
Registered: Jun 2004
Location: PAKISTAN
Posts: 46

Rep: Reputation: 15
put this in you ~/.bash_profile

JAVA_HOME=<path to your java diectory> export JAVA_HOME


add $JAVA_HOME/bin to you PATH..

take care
 
Old 07-02-2004, 09:06 AM   #3
Bengbers
LQ Newbie
 
Registered: Sep 2003
Location: Netherlands
Distribution: Redhat 7.2, 8.0, 9.0
Posts: 10

Rep: Reputation: 0
A nice way to store all the java-settings is to add the file java.sh to /etc/profile.d

Place all the java-settings such as JAVA_HOME, J2EE_HOME, CATALINA_HOME and so on in this file and after making this file executable (chmod +x java.sh), all the settings will be available to all the users on this machine

Ben

Last edited by Bengbers; 07-02-2004 at 09:09 AM.
 
Old 07-02-2004, 09:55 AM   #4
pycoucou
Member
 
Registered: Apr 2004
Location: Edinburgh
Posts: 78

Rep: Reputation: 15
in my bash profile, I've just added:
export CLASSPATH=$CLASSPATH:~/java (if .class files are in $HOME/java)
and
PATH=$PATH:/usr/java/j2sdk1.4.2_03/bin
to be able to run java and javac

why do you use extra variables??

Cheers,
Pierre-Yves
 
Old 07-04-2004, 04:05 AM   #5
antony_csf
Member
 
Registered: Jun 2004
Posts: 51

Original Poster
Rep: Reputation: 15
thx all !!
 
Old 07-15-2004, 09:49 AM   #6
Bengbers
LQ Newbie
 
Registered: Sep 2003
Location: Netherlands
Distribution: Redhat 7.2, 8.0, 9.0
Posts: 10

Rep: Reputation: 0
Quote:
Originally posted by pycoucou

why do you use extra variables??

Cheers,
Pierre-Yves
Because I use Tomcat to server jsp-pages (CATALINA_HOME) and because using JAVA_HOME and J2EE_HOME makes it easier to experiment with other/newer Java-versions

Ben
 
Old 11-25-2004, 08:25 AM   #7
Hiper1
LQ Newbie
 
Registered: Nov 2004
Posts: 16

Rep: Reputation: 0
I am a newbie

Tell me what exactly is CATALINA_HOME, and where will I find it
 
Old 11-25-2004, 09:34 AM   #8
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
I am a newbie
Tell me what exactly is CATALINA_HOME, and where will I find it
Here it is !
http://buildernew.jimandjohn.ca/inde...64&article=264
Sorry, I couldn't resist ...
 
Old 11-26-2004, 03:57 AM   #9
Hiper1
LQ Newbie
 
Registered: Nov 2004
Posts: 16

Rep: Reputation: 0
Quote:
Originally posted by antony_csf
thx all !!

Once I created the Java.sh file inside /pofile.d , what exactly do I type in there.I am very new at this.

So can you please help me
 
Old 11-26-2004, 05:48 AM   #10
Bengbers
LQ Newbie
 
Registered: Sep 2003
Location: Netherlands
Distribution: Redhat 7.2, 8.0, 9.0
Posts: 10

Rep: Reputation: 0
My java.sh contains:
export JAVA_HOME=/usr/local/j2sdk1.4.2_04
export CATALINA_HOME=/usr/local/jakarta-tomcat-5.0.25
export ANT_HOME=/usr/local/ant
PATH=$PATH:$JAVA_HOME/bin:$ANT_HOME/bin

To my knowledge, the JAVA_HOME variable is used by all kinds of Java-software that needs a Java runtime environment such as Open Office or the Eclipse development tool.
The first versions of Tomcat needed the CATALINA_HOME setting. I don't know if this setting is still mandatory but I still maintain it.
Ant is a make-utility

Ben
 
  


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
How to set CLASSPATH of java in Linux? vanhelsing Programming 1 08-23-2004 06:16 AM
I've set the CLASSPATH, but I still get a noClassDefFoundError. (Java) Travis86 Programming 6 02-05-2004 09:09 AM
set classpath in linux(slackware9) for java Manjula.S Linux - Software 1 10-16-2003 02:10 AM
set up path,classpath in linux(slaware9) for java Manjula.S Linux - Software 5 10-06-2003 11:38 PM
How to set classpath for java jolly Linux - Software 3 04-22-2003 10:02 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

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
Open Source Consulting | Domain Registration