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, ∼3663🔥, 0💬
Popular Posts:
Xalan-Java, Version 2.7.1, is an XSLT processor for transforming XML documents into HTML, text, or o...
JDK 17 jdk.localedata.jmod is the JMOD file for JDK 17 Localedata module. JDK 17 Locale Data module ...
maven-settings-builder-3 .8.6.jaris the JAR file for Apache Maven 3.8.6 Settings Builder module. Apa...
JRE 5 sunjce_provider.jar is the JAR file for JRE 5 Sun JCE Provider, which provides implementations...
JDK 11 jdk.internal.vm.ci.jmod is the JMOD file for JDK 11 Internal VM CI module. JDK 11 Internal VM...