Results 1 to 3 of 3
I have read various articles on setting classpath in linux, but couldn't get through and I am still unclear as to how to set the classpath in linux?
I even ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 09-25-2012 #1Just Joined!
- Join Date
- Sep 2012
- Posts
- 1
setting classpath for mysql java connector in linux
I have read various articles on setting classpath in linux, but couldn't get through and I am still unclear as to how to set the classpath in linux?
I even copied the 'mysql-connector-java-5.1.22-bin.jar' in my project src folder where the .class file is generated but still no success.
I also tried setting the classpath at runtime by: export CLASSPATH=/opt/integra/middleware/LCPAnalyzer/src/mysql-connector-java-5.1.22-bin.jar
but then i got the NoClassDefFoundError exception:
- 10-03-2012 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 10,232
There are two ways to set the classpath. One is to use the environment variable CLASSPATH. The other is to specify the classpath option on the Java command line. For the environment to work, you need ALL of the paths to jar files needed. When I started doing serious Java development earlier this year, this was a major part of my learning curve...
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 10-11-2012 #3Just Joined!
- Join Date
- Apr 2012
- Location
- Australia
- Posts
- 26
CLASSPATH variable can be set in user /etc/proc file to automatically be looked for to run a java program. If its web server then put the jar in /WEB-INF/lib of the application.
for commandline -cp or -classpath is a ; separated list after classpath.
run on the command terminal
java -h and look at the options.


Reply With Quote
