开发者

I am making software in java. Tell me how to convert .java file to .jar file that can be runnable [duplicate]

开发者 https://www.devze.com 2023-02-21 01:26 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Selecting main class in a runnable jar at runtime
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Selecting main class in a runnable jar at runtime

开发者_运维知识库

Help me to convert .java file to .jar


use jar command

jar cf jar-file input-file(s)


You can't convert java to jar file. You can, however, build a jar file with the jar command or use a build tool, like Ant to create a jar (or use an IDE to export as jar).


If you want to make it "runnable", you also want to specify the Main-Class and the Class-Path in the Manifest file:

http://download.oracle.com/javase/6/docs/technotes/guides/jar/jar.html

0

精彩评论

暂无评论...
验证码 换一张
取 消