Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Richard Torres   on Apr 28 In Java Category.

  
Question Answered By: Volney Fischer   on Apr 28

I am writing a Java class  MyTest.java with methods to call functions
(also java  methods) in an API, and return  a result. My Java works fine
in my IDE (Jcreator) but when I compile and call the same methods from
my application, or from the command line, I get eg

Exception occurred: java.lang.ClassNotFoundException
(uncaught)"thread=main", java.net.URLClassLoader$1.run(), line=199
bci=72

which looks to me that the class definition existed when I compiled,
but can no longer be found.

Other methods in MyTest class that don't call the API work  fine.

I have set the CLASSPATH in the System Control Panel, it looks fine,
though I note that when I checked the classpath from the command line
in JDB it has commas rather than the semicolons; both have
backslashes.

I have also created a method  in CallAPI to set the classpath with
System.setProperty ("java.class.path" ...) I can call that from my
app; it sets the classpath (with forward slashes) but still get the
exception when I call any method that calls a class in the JARs
library

I am struggling to see what's different between the IDE and the
compiled class.

Share: 

 

This Question has 5 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Class not found Or get search suggestion and latest updates.


Tagged: