Java News Tips Software
Java News Tips Software | Contact | Facebook | Twitter RSS

How to open a .war (web archive) or .jar (java archive) files

With Java we generate .JAR files to bundle a set of resources. For J2EE web applications, we generate .WAR (Web Archive) files for deployments. Both of these are ways of archiving a set of files.

Both these .jar or .war archives are in zip format. So there are plenty of ways to open those files to read the content. One way would be to use any tool that you use to open/extract a .zip file. Next will be to use the Jar command itself.

JAR Command
JAR (command) utility in Java can be used to open/extract these files as follows. Run following command from the folder where you need the content to be extracted by providing the path to the archive.

jar xf <path-to-file>

options:
x - extract the files
f - file to extract

jar xf myWebApp.war
jar xf myProject.jar

Related : Open and read a file inside a war file of a web application with Java

Labels: ,


4 Comments

  1. So it's also in zip format? Why does Java uses .zip format?
  2. When I was on resort and some important zip files were corrupted,one man helped me,he had advised-zip files 2gb microsoft,tool has free status as far as I remember,it has many facilities such as-can save a lot of free space on hard drives and removable media,also split files, it is used, when forwarding large files by email,can work with all Windows family, from Windows 98 to Windows Vista,program for extracting zip files 2gb Microsoft,allows choosing only those files, that can be successfully repaired,save extracted documents to your hard drive and finish the process,can extract your documents from corrupted Zip files.
  3. Anonymous Anonymous on May 18, 2010 6:26 PM  
    this error was displayed when i try to start the tomcat server.......

    java.lang.ClassNotFoundException: org.springframework.core.SmartClassLoader
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1384)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1230)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1890)
    at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:887)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1351)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1230)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at org.springframework.web.servlet.FrameworkServlet.class$(FrameworkServlet.java:105)
    at org.springframework.web.servlet.FrameworkServlet.(FrameworkServlet.java:105)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at java.lang.Class.newInstance0(Class.java:355)
    at java.lang.Class.newInstance(Class.java:308)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1116)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4458)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:984)
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:907)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:495)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1211)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:741)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:587)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:290)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)





    plz help me..............
  4. I have known some interesting tools for solving other problems. But once I came upon a problem with zip files. Fortunately one tool could settled this issue and it would be usable for resolving any troubles on my view - how to fix zip files.
ABOUT AUTHOR
Page Views :
Email :
PREVIOUS ARTICLES
Select Month:
TOP
Free counter and web stats