Oddwit


EclipseでJavaコードを実行すると「Could not find the main class. Program will exit.」

Posted in Java by マルコ on the July 11th, 2007

症状

EclipseでJavaのプログラムをビルド・実行しようとすると

Could not find the main class. Program will exit.

とメッセージがポップアップし、さらにコンソールでは

java.lang.UnsupportedClassVersionError: FooClass (Unsupported major.minor version 50.0)

と怒られる。

コマンドプロンプトから直接コンパイルして実行するとうまくいく。

解決方法

Windowメニュー→ PreferencesJavaCompilerCompiler Compliance Level を変えてみる。

Leave a Reply