Help! Since I installed Robocode, my original Java isn't working anymore

From RoboWiki
Jump to: navigation, search

Hello, please forgive me if this isn't the right place to post this. I'm a noob to Java; two months ago I installed the JDK from Oracle and played around with the examples from the book "Java - A Beginner's Guide". It worked nicely until I installed Robocode. Now, Robocode is working fine, but regardless which of the example programs I try to run, I get the same error:

cd the_directory_that_contains_Example.class 
java Example.class 
Error: Could not find or load main class Example.class

I tried recompiling Example.class from Example.java, but that didn't help. I googled for this error; I found a nice reply at stackoverflow.com/questions/3005433/java-problem-could-not-find-main-class-helloworld, so I tried to explicitly point it to the class directory:

java -classpath . Example.class

But this didn't help either. BTW, I had added the follwing two environment variables for Robocode, but from what I read, they shouldn't matter:

JAVA_HOME="C:\Program Files\Java\jdk1.7.0_07"
Path=C:\Program Files\Java\jdk1.7.0_07\bin;C:\WINDOWS\system32;...

Please help me with this. Thanks!

Astacus19:23, 4 November 2012

Hi mate ... Not sure but i guess it should be:

java -cp . Example

not Example.class. Let me know if this worked out for you

Wompi23:51, 4 November 2012
 

That's it! Thanks a lot!

Astacus00:15, 5 November 2012
 
Personal tools