If you have Java Archive files such as jar, war, or ear and you want to extract them using the Linux command then make use of the jar command.
.jar - Java Archive File
.war - Java Web Archive File
.ear -Enterprise Java Archive File
Command to extract Java .jar file
Syntax:# jar -xvf /path/to/file/fileName.[war|ear|jar]
Example:
# jar -xvf myApp-uat-2.0.1-SNAPSHOT.war
Make sure you have Java JDK installed on the system to use this command, or else you will get an error.
# jar -xvf my-production-2.0.1-SNAPSHOT.ear
The operation couldn’t be completed. Unable to locate a Java Runtime.

-
Have Questions? Post them here!
More Posts related to Java,
- How to get Java Thread name Example [Program]
- Java 8: Get First and Last Date of the Week for Given Date
- Convert String to int in Java
- How to Get List of All Country Codes in Java Using Locale Class
- Convert Multidimensional Array toString In Java
- [Fix] java: incompatible types: incompatible parameter types in lambda expression error
- Display Era details (AD BC) in Java Date using SimpleDateFormat
- Create a Zip file using Java Code programmatically
- [Fix] java.net.MalformedURLException: unknown protocol
- [fix] Java JDBC ConnectException: Connection refused
- Read Json File and Convert to Java Object using Jackson
- list of jars required for hibernate 4.x.x
- Simple Struts 2 Tutorial in eclipse with tomcat 7 server
- Java: The value of the local variable string is not used
- [fix] URI is not registered (Settings | Languages & Frameworks | Schemas and DTDs) IntelliJ
- Java 8+ get Day of the Week Examples with LocalDateTime, DateTime, ZonalDateTime and Instant classes
- Run SQL Script file using Java JDBC Code Example
- Remove Trailing zeros BigDecimal Java
- Java JDBC IN Clause Example with PreparedStatement MySQL
- Convert Java List to Json String using Jackson
- Java 8 foreach loop code examples
- error: file not found: HelloWorld.java
- IntelliJ Keyboard Shortcut to remove unused imports [Java]
- Exception in thread main java.lang.NoClassDefFoundError: package javaClass
- Struts 2 Hello World Example in Eclipse
More Posts:
- Microsoft 365 Excel - PRO TIP Discover insights quickly with Power BI, which is already included in your Microsoft services, See it in action - Microsoft
- Read a file line by line in Python Program - Python
- SharePoint error - An exception occurred when trying to issue security token: This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.. - SharePoint
- Difference between using Scanner Class and String args for user input in Java - Java
- How to install Python 3.11 on Mac - Python
- #HappyBirthdayJimin hashtag trending on BTS Jimin 25th birthday [BTS ARMY] - BTS
- Update SharePoint Online List Item using REST API, HTML, Spfx, Postman - SharePoint
- Top 3 Awesome Text Editors developers prefer at workplace - Sublime