Forum Stats

  • 3,759,870 Users
  • 2,251,609 Discussions
  • 7,870,847 Comments

Discussions

What is going on here?

843798
843798 Member Posts: 24,864
edited Jun 26, 2001 1:06AM in Java Runtime Environment (JRE)
Hi all,

nt4 jdk1.3 jre1.2.2

I have written a simple program that prints my name. When I tried to run it from the command line today i got the following:

Exception in thread "main" java.lang.NoClassDefFound: ProgressTest

I now can't run any of the programs I have written. I haven't changed either the path or classpath variable. Anybody got any ideas what is happening here?

Comments

  • 843798
    843798 Member Posts: 24,864
    Okay, to make life simple and to prove to yourself that you are not going crazy, write a HelloWorld program and do not place it in a package. For example:
    public class HelloWorld {
      public static void main(String args[]) {
        System.out.println("Hello, World!!");
      }
    }
    Compile it as normal from the directory the HelloWorld.java is in:

    javac -classpath .\ HelloWorld.java

    and make sure you see HelloWorld.class (I put the classpath switch in there to make sure that there isn't a bunch of garbage in you classpath).

    Now, run it like this:

    java -classpath .\ HelloWorld

    If that works but it doesn't work when you remove the classpath switch, then the problem is that you don't have the current directory in your classpath (.\).
This discussion has been closed.