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, 3279🔥, 0💬
Popular Posts:
JDK 11 java.security.jgss.jmod is the JMOD file for JDK 11 Security JGSS (Java Generic Security Serv...
What Is javax.websocket-api-1.1. jar?javax.websocket-api-1.1. jaris the JAR file for Java API for We...
JDK 1.1 source code directory contains Java source code for JDK 1.1 core classes: "C:\fyicenter\jdk-...
Jackson is "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java"....
Apache BCEL Source Code Files are inside the Apache BCEL source package file like bcel-6.5.0-src.zip...