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



On 30 Sep 2005 07:57:53 -0700, thickface wrote:
> I used both with class and without class. I got the same following
> message.

*Without* is the right one. java wants the name of the class, not the
name of the class file.

> Exception in thread "main" java.lang.NoClassDefFoundError:
> HelloWorldApp(/class)
>
> I was able to compile and run in the Linux machine at the University.
> So, seems like problem is in my laptop envirionment.

If you're in the same directory as the class file, try it like this:

java -cp . HelloWorldApp

(I'm assuming you've correctly compiled with javac prior to this)

/gordon


--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
.



Relevant Pages

  • Code Cracking in Java
    ... Software developers, designers, security professional, auditors, managers responsible for evaluating products. ... I love programming in Java but unfortunately I didn’t get a chance to work in software development firm but I am very much happy with my profile, basically I am an ethical hacker currently working in Wipro and previously in PwC. ... For security reasons I will not mention client name, application vendor and detail about the application architecture. ... As we commonly know that the basic loophole in Java is that it can be reengineered from class file to source code, the class file consist of byte codes which is interpreted by Java Virtual Machine to make Java platform independent. ...
    (Pen-Test)
  • Re: java 101 question - how to run a java program
    ... do "javac java01.java". ... .class file in the same directory as the .java file. ... File "java01.java" not a Java class file. ... Unable to create Java program for "java01.java". ...
    (comp.sys.ibm.as400.misc)
  • Re: jar, package and import relationship?
    ... Java does too: the CLASSPATH must be correct. ... It's a bit different for anything that comes with the default with Java, because the JVM handles those a bit differently with out environment variables, but for any library or .class file you download or create, you need to tell your tools where to find them. ... public static void main(String ... ...
    (comp.lang.java.programmer)
  • RE: RH 7.2, J2RE 1.4 and Netscape 7.1
    ... The reason for some problems between 1.4x and 1.4.2 are class file ... format changes. ... I have had multi issues with some of my prebuilt java ... Netscape may even be doing that. ...
    (RedHat)
  • Re: Package and compiling
    ... When I compile a java source file with a package statement I ... > class file there. ...
    (comp.lang.java)