1

I am using Eclipse for running my applications.

=> All this time I have been running as a java application (using Run as Java application option) and it works.My program executes for 20 minutes and prints some data .

Now I tried to create a Runnable jar. I am able to get jar file and execute.But it exits after 1 minutes.There are no prints from SOP.I have kept one just immediately after main and that is also not getting printed. How to debug this?

I am getting this Error now:

JAR export finished with warnings. See details for additional information.
  Exported with compile warnings:input.java
  Jar export finished with problems. See details for additional information.
    Could not find main method from given launch configuration.

But there is a public static void main(String[] args) in the input.java file. I am not sure why is it complaining when I try to run from command prompt and it gives no main manifest attribute.I did not create any file with that name. What has gone wrong here ?

4

2 に答える 2

0

マニフェストは、「Main-Class」ディレクティブを含む1行のテキストファイルです。このファイル(manifest.txtのような便利なものと呼びます)をメモ帳などで作成する必要があります。

次の行が必要なファイル:Main-Class:file2

行の終わりにハードリターンがあることを確認してください。

次に、次のようにjarを使用します。 jar cvfm sample.jar manifest.txt *.class

于 2012-10-09T09:36:42.740 に答える