Re: NoClassDefFoundError:

From: Cid (cid_at_noSuchAddress.no)
Date: 07/27/04


Date: Tue, 27 Jul 2004 17:36:18 -0400

On Tue, 27 Jul 2004 19:53:20 GMT, "vivienne wykes"
<vw011g3667@blueyonder.co.uk> wrote:

>Thanks for that :
>
>I am using scite : http://scintilla.sourceforge.net/SciTEImage.html
>
>I set it up in thinking that it would give informed error messages for java
>compiling
>Would I be right in thinking that if I open my .java file and scite knows
>where its jikes compiler is ,
>which I think it does, and the class files are appearing why the classpath
>issues?
>
>the scite error output is
>
>The output is
>C:\j2sdk1.4.2_05\bin\java -classpath
>"C:\j2sdk1.4.2_05\jre\lib\rt.jar";"C:\Program
>Files\wscite\junit.jar";C:\ADDONS ;. -ea AddWedding2
>java.lang.NoClassDefFoundError: ;/
>Exception in thread "main" >Exit code: 1

1. It's highly recommended that you learn how to use the java command
line tools (javac, java) before you start using an IDE. The problem
you're having is an example why. Once you are familiar with invoking
java manually you will be able to recognize error messages like this
and sort them out in the context of whatever IDE you choose to use
later on. If you start with an IDE then you have to learn the IDE and
java at the same time which is gonna hurt.

2. I don't know scite so I can only guess from your output (though it
is a step in the right direction, thanks for providing it).
Specifically the error message looks like it's missing the name of the
class you were trying to run. Normally I would start my class MyApp
from the command line like this:
        java MyApp

If there is no MyApp.class in the current directory, I would see an
error message like this:

Exception in thread "main" java.lang.NoClassDefFoundError: MyApp

So either you lost part of the error message or your IDE doesn't
actually know the name of the class it's supposed to run. In the
latter case, you'll probably have to hit the app's web site or some
forum/ng specific to it.

Basically, I encourage you to ditch the IDE for now and get comfy with
the command line tools for a few weeks at least.

3. Unrelated to your problem, and others may disagree with me here,
but I don't generally approve of System.exit(). It's heavy handed and
messy - unless you really know what you're doing and/or really need to
stop the JVM _now_. Otherwise, just leave it out and your app will
shut down when you hit the end of main().



Relevant Pages

  • Re: ILC2005: McCarthy denounces Common Lisp, "Lisp", XML, and Rahul
    ... > well as correct program. ... Sometimes I *want* to run program fragments ... development in Java too. ... that will break just to make sure the error message is working, ...
    (comp.lang.lisp)
  • Re: A constructive debate: Eclipse or NetBeans?
    ... In my experience Netbeans is slower than is Eclipse, ... That's because most people never learn to use a command line or a simple ... facilities of a well designed IDE are invaluable. ... I started by trying to find OpenGL bindings for Java but, amazingly, ...
    (comp.lang.java.softwaretools)
  • Re: IE 6 Generating Error Message and close down
    ... and same error message was generated. ... It appears that the problem lies with the web site. ... Try going to the root site http://www.esd.gov.hk first and then navigating ... my settings to verify compatibility to their program using Java. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: help me in java
    ... The "java" command takes a class as an argument, ... but I have tried with java ap1. ... Exactly what you type, exactly what the error message is, exactly what the paths are to the .class files, and the source too. ... You can do this all on the command line, then copy and paste it here, directly from the screen. ...
    (comp.lang.java.help)
  • Re: various java problems
    ... If you get the error message ... You may be getting the download from your cache. ... Windows Offline Download and Installation Instructions for the JavaT 2 ... Java for a particular reason, and now I cannot re-install it as an error ...
    (microsoft.public.windows.inetexplorer.ie6.browser)