java - FileNotFoundException using JAR command to unzip WAR in Batch file -


running java 1.8.0_141. ran problem 1.8.0_121. i

running following command extract contents of war temp directory:

mkdir temp cd temp %java_home%\bin\jar -xvf ..\petclinic_sdk.war 

the petclinic_sdk sample project i'm using can found here: https://github.com/spring-projects/spring-petclinic

it seems extract correctly, appears try extracting libraries contained within war. error:

java.io.filenotfoundexception: org.springframework.web.servlet-3.0.5.release.jar  (the system cannot find file specified)     @ java.io.fileinputstream.open0(native method)     @ java.io.fileinputstream.open(fileinputstream.java:195)     @ java.io.fileinputstream.<init>(fileinputstream.java:138)     @ sun.tools.jar.main.run(main.java:261)     @ sun.tools.jar.main.main(main.java:1288) 

that jar lives in /temp/web-inf/lib/org.springframework.web.servlet-3.0.5.release.jar after extraction.

the problem need temp directory clean of temporary files. because appears trying extract jars well, /temp full of jartmp******************.tmp files: temp directory after extraction

thoughts?

my mistake. loop containing above code recursive.

working code here:

@echo off setlocal enabledelayedexpansion  %%i in (*) (    if %%~xi == .jar (         rem ...    )    if %%~xi == .war (        set foo=%%~ni%.war        mkdir temp        cd temp        %java_home%\bin\jar -xvf ..\!foo!         rem ...    )     if %%~xi == .ear (         rem ...    ) ) 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -