newbie exceptions question

N

Nandan

java -classpath WizTest_fat.jar bm.Tests.TestDiv tests/divtest4.xml
Exception in thread "main" java.lang.NoClassDefFoundError: bm/Tests/TestDiv

It might be worthwhile to catch this exception in the program and
offer a more informative error message.

am I correct in thinking the following?

That will not work. There is no way to catch that exception, as I understand
it. It isn't even a 'real' exception, as none of our code has been executed
at that point. It is really an error message from the java interpreter to
say it couldn't find the file. I may be wrong on this though, I will check.
 
A

Andrea Desole

Nandan said:
java -classpath WizTest_fat.jar bm.Tests.TestDiv tests/divtest4.xml
Exception in thread "main" java.lang.NoClassDefFoundError: bm/Tests/TestDiv





am I correct in thinking the following?

That will not work. There is no way to catch that exception, as I understand
it. It isn't even a 'real' exception, as none of our code has been executed
at that point. It is really an error message from the java interpreter to
say it couldn't find the file. I may be wrong on this though, I will check.

Well, considering that the class hasn't been found I don't see how its
code can be executed.
No, probably it wouldn't work

Andrea
 
N

Nandan

Andrea said:
Well, considering that the class hasn't been found I don't see how its
code can be executed.
No, probably it wouldn't work

Andrea


So rather than call it an exception, is it more correct to say it's an
interpreter error message?

Thanks,
Nandan
 
A

Andrea Desole

Probably not. It's a regular runtime exception that is thrown by the JVM
when a class is not found; not necessarily your main class. This means
that you can get it anywhere in your code.
 
F

Fahd Shariff

The class bm.Tests.TestDiv can't be found. Make sure its in the jar
WizTest_fat.jar since that is the only place that is being searched...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top