This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Modern JavaScript for the Impatient and have Cay Horstmann on-line!
See this thread for details.
Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Updating a jar

 
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.io.IOException: Error in writing existing jar file
at sun.tools.jar.Main.run(Main.java:174)
at sun.tools.jar.Main.main(Main.java:899)

What does this error mean? I have created a jar file and when I type :
jar uf vjmonitor.jar *.properties
I get this error. I was not getting it before and unless I'm losing my sight, I can't see what's different.
Thanks.
Paul
 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The jar file is probably still open by some application/process, so you can't update it until it is closed.
 
Paul Keohan
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Billybob. I didn't see any other process using it but when I restarted my machine it worked.
Another jar question :
I run this bat file on an XP machine.
@ECHO OFF
del *.class
javac -classpath .;..\include_files\classes12.zip *.java
del vjmonitor.jar
jar cvf vjmonitor.jar *.class
jar uvf vjmonitor.jar -c ../include_files *.gif
jar umvf manifest.txt vjmonitor.jar
del *.class
copy vjmonitor.jar ..\scripts\vjmonitor.jar
pause
REM monitor

When it come across the highlighted line above, it says there's no such file or directory but proceeds to copy EVERYTHING in the include_files directory into my jar file anyway. There's even a db file copied which I can't find anywhere. Why is this? All I want is to copy in the gif files from another directory with the same parent.
Paul
 
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul
Try to do CD explicitly by first doing,
CD ..\include_files
<<your jar command that you have highlighted with removal of -c switch>>
CD ..\<<your directory where you were earlier>>
and see if it works.
Regards
Maulin
 
Paul Keohan
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But then it won't find the jar file in the include_files directory - unless it copies that over too.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic