[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 442
  • Last Modified:

Exception in thread "main" java.lang.NoClassDefFoundError

Hello all,
   This is a simple question, but one that makes me want to put my fist through my monitor.  I've got an environment problem that I can not figure out.  I've got the traditional "Hello World" program:

class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!"); //Display the string.
    }
}

It compiles fine, but when I try to run it I get:
Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp

The application sits in a directory called D:\jdk1.1.8\SOURCE.  My classpath variable is set to CLASSPATH="D:\jdk1.1.8\SOURCE;D:\jdk1.1.8\lib;

I am stumped.

Thanks
0
edc
Asked:
edc
1 Solution
 
sen_kumCommented:
Add '.' in classpath and try

SET CLASSPATH=.;D:\jdk1.1.8\SOURCE;D:\jdk1.1.8\lib;

'.' represents the current directore, so the file will be also checked in current directory
0
 
edcAuthor Commented:
That did the trick.  Thanks sen_kum.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now