• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Updating Jar Problem

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
Using ant 1.6.0. <jar> works fine without "update" attr, but setting to true results in: "unable to rename old file... to temporary file."
Windows environment. build.xml fragment:
<jar basedir="." jarfile="${archive}" includes="**/${filename}.class" update="true" />
All insights greatly appreciated !
[ January 12, 2004: Message edited by: Joe Fisher ]
 
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry Joe I am not up to speed with the NAT 1.6 changes..however could you post a little more lines of your build say about 5 lines before and after that line so we can see waht is going on more clearly?
 
Joe Fisher
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for looking into this Fred... Entire build file (w/o xml header):
<project name="Topic 1, Lab 2" default="startup" >
<property name="filename" value="Lab2" />
<property name="archive" value="Lab2.jar" />
<target name="startup" >
<javac srcdir="." includes="${filename}.java"/>
<jar basedir="." jarfile="${archive}"
includes="**/${filename}.class" />
<delete file="${filename}.class" />
</target>

</project>
Adding attribute update="true" to jar task causes the problem.
I have found evidence of this problem on the net, but not a lot, and no firm resolution.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I too am having the same issue. Has anybody found a solution:

I want this to update an existing jar file, however I get the error:
Unable to rename old file to temporary file
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I got this too and have found it to be a simple issue of one of my other programs locking the .jar file. To test this what to do is simply quit out of the ant script (though it has probably already crashed out!) then try renaming the .jar file manually in DOS. "rename myJar.jar newTempName.jar" and it will give you an operating system error message. So just keep retrying your ant script as you close down other programs you have open until it works.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I find that sysinternals' ProcessExplorer is excellent for finding this common culprit. http://www.systeminternals.com/. Just use the [find->find handle or dll] feature to see which processes have open handles to a certain file. Great stuff!
 
Slime does not pay. Always keep your tiny ad dry.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic