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.

-
Facing issues? Have Questions? Post them here! I am happy to answer!
More Posts related to Java,
- Java equals method - Tutorial
- Unbound classpath container: JRE System Library [JavaSE-1.7]
- Spring Boot: @RequestBody not applicable to method
- Java 8: Steam map with Code Examples
- Java Program: Random Number Generator
- Java java.time.Clock class code examples [Java Date Time API]
- Fix: type argument is not within bounds of type-variable T
- [Fix] java.net.MalformedURLException: unknown protocol
- Java 7 addSuppression() and getSuppression() Exception Handling
- Convert Java Array to ArrayList Code Example
- How to Word-Warp Console logs in IntelliJ
- Ways Compare Dates in Java Programming with Examples
- Remove Trailing zeros BigDecimal Java
- CRUD operations in Spring Boot + JDBC
- [Java Threads] Should we extend Thread Class or implement Runnable interface
- Json Serialization and Deserialization using Java Jackson
- Create simple struts2 project using maven commands
- How to install Java OpenJDK 11 on Alpine Linux
- Unsupported major.minor version 52.0 in java
- Error: Can not find the tag library descriptor for
- Java: Convert String to Binary
- How to run Java Unit Test cases with Apache Maven?
- Java: Testing Private Methods in JUnit using reflection API Example
- Java JDBC Connection with MySQL Driver in VS Code + Troubleshooting
- Java Join Strings with Comma Separator
More Posts:
- Java 8 foreach loop code examples - Java
- Android Studio NoClassDefFoundError: java.awt.Toolkit - Android-Studio
- Time Testing with Java JUnit assertTimeout method - Java
- [macOS] NetBeans IDE cannot be installed. Java (JRE) found on your computer but JDK XX or newer is required. - MacOS
- [fix] Spring Boot Data JPA - No identifier specified for entity - Java
- Fix: zipfile.BadZipFile: File is not a zip file Python - Python
- Flash Player will no longer be supported after December 2020. Turn off [Google Chrome] - Chrome
- Deep Dive: Java Object Class from java.lang Package - Java