Hi Friends, I have a servlet and a java class under the same package. I call the java class from the servlet i.e:
And I get this error message:
I don't understand if both the class files are in the same location, how can it not find the second class??? Moreover if I go to that same location using command line and give the same command there,it works fine...
Can someone please tell me how to resolve this classpath issue???
Executing a process this way is not the same as starting it from the command line. In particular, the class which starts it has no bearing on directories, classpaths used etc. Add an explicit classpath to your command, and it should work fine.
But since you're running a Java program, wouldn't it be much more elegant to instantiate an object of type 'JavaClass', and then call its methods directly?
posted 12 years ago
Thanks Ulf, That resolved the issue...I want to fork out the process and run it under a separate JVM,thats why i did that...
SCJP 1.4 (88%)<br />SCWCD 1.4 (88%)
Poop goes in a willow feeder. Wipe with this tiny ad: