Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
"jar -ufe" Command to Create an Executable JAR
What is the "jar" command to create an executable JAR? I know the starting class name in the JAR file.
✍: FYIcenter.com
If you know the starting class name and that class is in the JAR file, you can use the "jar -uvfe jarname classname" to make JAR file as executable.
For example, I want to make myNew.jar executable with the Hello class:
\fyicenterjar>"%java_home%\bin\jar" -uvfe myNew.jar Hello updated manifest \fyicenter>"%java_home%\bin\java" -jar myNew.jar Hello new world! \fyicenter>"%java_home%\bin\jar" -xvf myNew.jar \fyicenter>type META-INF\MANIFEST.MF Manifest-Version: 1.0 Created-By: 1.8.0_45 (Oracle Corporation) Main-Class: Hello
As you can see from the output, "jar -uvfe myNew.jar Hello" command just added "Main-Class: Hello" to the MANIFEST.MF file. Of course, you can manually, edit the MANIFEST.MF file and put it in the JAR file.
Back to FAQ for JDK JAR (Java ARchive) Tool.
2016-06-13, ∼3927🔥, 0💬
Popular Posts:
Jackson is "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java"....
maven-model-builder-3.8. 6.jaris the JAR file for Apache Maven 3.8.6 Model Builder module. Apache Ma...
JDK 11 jdk.javadoc.jmod is the JMOD file for JDK 11 Java Document tool, which can be invoked by the ...
JDK 11 jdk.javadoc.jmod is the JMOD file for JDK 11 Java Document tool, which can be invoked by the ...
Apache Ant is a Java-based build tool. In theory, it is kind of like make, without make's wrinkles. ...