• Post Reply Bookmark Topic Watch Topic
  • New Topic

Running Java on Linux  RSS feed

 
Mukesh Yadavander
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have mandreak Linux 9.1. I have sucessfullt installed J2SDK1.4.0.
Now whenever I have to compile and run a standalone app. or an applet I have to inside the JDK BIN dir. But I want to set the PATH and CLASSPATH environment variables so that I can run javac and java utility from any dir.
How do I go about that?
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
you have different possibilities.
1. you set the PATH variable in /etc/profile. This file is loaded for everybody
who logs on.
2. you set the PATH variable in: ~/.bashrc (maybe you have to create this file)
This file only works when your working shell is a bash. Then it is loaded.
In both cases you have to insert the following line:
export PATH=$PATH:$JAVA_HOME/bin
This assumes that JAVA_HOME is pointing to your install dir of J2SDK and exists.
The same way you can create the CLASSPATH variable.
export CLASSPATH=$CLASSPATH:your jars
Olli
[ July 28, 2003: Message edited by: Oliver Refle ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!