-1

Possible Duplicate:
Selecting main class in a runnable jar at runtime

Help me to convert .java file to .jar

Community
  • 1
  • 1
desprado
  • 136
  • 1
  • 2
  • 13

3 Answers3

3

use jar command

jar cf jar-file input-file(s)
jmj
  • 237,923
  • 42
  • 401
  • 438
1

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).

Buhake Sindi
  • 87,898
  • 29
  • 167
  • 228
1

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

Puce
  • 37,247
  • 13
  • 80
  • 152