How to run a .class file in Windows 7 OS?

Posted by jNoob on Stack Overflow See other posts from Stack Overflow or by jNoob
Published on 2010-06-07T23:43:08Z Indexed on 2010/06/07 23:52 UTC
Read the original article Hit count: 172

Filed under:
|
|
|
|

Hi,

This is probably a stupid question, but how do I run a class file on windows 7? I usually create my own .java files and then use a basic IDE (with JDK6) to compile it to a class and run it automatically. My professor gave a .class file that we are supposed to play with extensively but I have no idea how to to run it here. Note that I cannot run it by typing:

java classname.class

because it contains gui stuff especially buttons and such. If I do the above I get the following error:

java.lang.NoClassDefFoundError: Test1/2/class
Caused by: java.lang.ClassNotFoundException: Test1.2.class
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: Test1.2.class.  Program will exit.
Exception in thread "main" 

Any help would be highly appreciated. Thanks.

© Stack Overflow or respective owner

Related posts about java

Related posts about Windows