5
Java .classファイルを実行するにはどうすればよいですか?
HelloWorldプログラムをコンパイルし、コマンドプロンプトを使用して実行しています。.classファイルの名前はHelloWorld2.classです。 このファイルはC:\ Users \ Matt \ workspace \ HelloWorld2 \ binにあります。コマンドプロンプトに移動して「JavaHelloWorld2」と入力すると、次のように表示されます。 C:\Users\Matt>Java HelloWorld2 Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld2 Caused by: java.lang.ClassNotFoundException: HelloWorld2 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) Could not find the main class: HelloWorld2. Program will …
81
java
compilation