Java – jar command not working in java while trying to extract file

java

When I try to unjar the files into my webapp folder using command prompt it keeps throwing error.

C:\Users\Jamuna\workspace1\TestSolr\webapp>java -jar -xvf C:\Users\Jamuna\Deskto
p\apache\apache-solr-4.0.0\dist\apache-solr-4.0.0.war

Unrecognized option: -xvf

Error: Could not create the Java Virtual Machine.

Error: A fatal exception has occurred. Program will exit.

Please let me know why this is happening???

Best Answer

You should run jar.exe, not java.exe. jar.exe should be in JDK/bin directory, i.e.

C:\Program Files (x86)\Java\jdk1.6.0_25\bin\jar.exe -xvf apache-solr-4.0.0.war