Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
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 (309)
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, 3280🔥, 0💬
Popular Posts:
How to download and install mysql-connector-j-8.0.31 .zip?Connector/J Java library is a JDBC Driver ...
JDK 11 jdk.rmic.jmod is the JMOD file for JDK 11 RMI (Remote Method Invocation) Compiler Tool tool, ...
What Is js.jar in Rhino JavaScript 1.7R5? js.jar in Rhino JavaScript 1.7R5 is the JAR file for Rhino...
How to download and install iText7-Core-7.1.4.zip? iText7-Core-7.1.4.zip is the binary package of iT...
JDK 11 jdk.internal.vm.compiler .jmodis the JMOD file for JDK 11 Internal VM Compiler module. JDK 11...