classpath for java in linux
1 posts in topic
Flat View  Flat View

Posted By:   sriram_nagarajan
Posted On:   Friday, April 25, 2003 05:03 AM

i have installed j2sdk in my system.

How to set the classpath for it so that

i can test whether it is working or not.

please give me the steps.

Re: classpath for java in linux

Posted By:   Simon_Ablett  
Posted On:   Monday, April 28, 2003 06:01 AM

There are several environment variables you need to set:


Set this to point to the directory in which J2SE is installed. e.g. if J2SE is installed in '/usr/apps/j2se/1.4' then you should use something like 'export JAVA_HOME='/usr/apps/j2se/1.4'.


Add the bin directory of your Java installation to the existing PATH. The command to do this, using the previous example, would normally appear akin to the following 'export PATH=/usr/apps/j2se/1.4/bin:${PATH}'


This should reference any directories containing '.class' files that you want to use it should also explicitly reference any '.jar' files. So, for example, if your program uses two jar files 'a.jar' and 'b.jar' which you keep in a directory '/home/myself/libs' plus a group of class files which can be found in '/home/myself/src/classes' then your CLASSPATH should be set to something to similiar to the fhe following 'export CLASSPATH=/home/myself/libs/a.jar:/home/myself/libs/b.jar:/home/myself/src/classes:${CLASSPATH}'.

Hope that this helps.

About | Sitemap | Contact