compiler construction - Cannot run simple compiled java program? -


I'm on ARC Linux, I'm just installing JRE and JDK and all the appropriate bin files (in Java and Java) / in / in

I've just compiled a standard world, and compiled it with javac running javac./hello.java and it's a Class is made.

Now my problem is running I run Java. / HelloWorld class and this gives me an error, even though I can not point to Java in the file:

  Exceptions to the thread "main" java.lang.NoClassDefFoundError: // helloworld / Class: java.lang.ClassNotFoundException: ..helloworld.class (called for clarity ..) Main category could not be found: ./helloworld.class program will exit  

You will see the first line of error, this path changes to // helloworld / class

when I give Java a complete feed The path, i.e java /home/foo/helloworld.class , gives the same error, but change the path to / with gives. , Again dumb

Do you think that's wrong? I really do not know why this is doing it ..

when you run Java You just pass it, it's a completely qualified class name (including the package), not the name of the file.

will look for helloworld helloworld.class.

java Helloworld.class will look for helloworld / class.class


Comments