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, 3337🔥, 0💬
Popular Posts:
Apache Log4j provides the interface that applications should code to and provides the adapter compon...
HttpComponents Client Source Code Files are provided in the source package file, httpcomponents-clie...
What Is jaxb-impl-2.1.12.jar? Java Architecture for XML Binding (JAXB) is a Java API that allows Jav...
JDK 11 java.sql.jmod is the JMOD file for JDK 11 SQL (Structured Query Language) module. JDK 11 SQL ...
maven-core-3.5.4.jar is the JAR file for Apache Maven 3.5.4 Core module. Apache Maven is a software ...