Hello, I'm having a small (but frustrating) problem trying to run my program.
When I run my program using:
java -classpath .;/lib/jl1.0.1.jar Main
It opens perfectly, but when doing an action that requires jl1.0.1.jar it gives me NoClassDefFoundError
Thanks in advance
Class path soluction
for example your jar file is ojdbc14.jar which is in d:\oracle\ora92\bin\jdbc\lib\ojdbc14.jar ....copy the complete jar file location so copy the whole location and paste it in the ...following position ....
my computer-->environmental variables.--->system variables-->new--------->
VARIABLE NAME : CLASSPATH
VALUE :PASTE THE VALUE;.(EXISTING VALUE)[DONT DISTRUB REMAINING]
MAKE SURE THAT your pasted value must be the first one.. and more over before you paste the value first see the value ..suppose oracle is the first value the it is dominated by the java path.so make sure jdk path is more preferably first value and the you paste the .jar value..
The problem isn't running it on my own computer, but when passing the program on to other people.
(I have the CLASSPATH set correctly on my own computer)
Do the 'other people' even have the jl1.0.1.jar?
Yes, but I already solved it by creating a jar file, and adding 'Class-Path: lib/jl1.0.1.jar' to it
Now I just need to do 'start Program.jar' to make it run
(I needed to be able to run it from command prompt)