This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Modifying existing jar file, how?  RSS feed

 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I have a problem trying to modify an existing jar file. When I want to create a jar file, I use something like:
REM build the application on windows, assuming the java/bin
REM directory is in the path environment variable
REM application is just the directory I am using
SET cp = c:\application\TestApp
javac -classpath %cp% TestApp.java
REM ****************************************
REM do packaging and adding manifest
REM ****************************************
jar cvfm App.jar manifest.mf TestApp*.class
REM ****************************************
REM run the jar file
REM ****************************************
javaw -jar App.jar

But now, I have an existing jar file (swingall.jar) and I want to modify a class within that file. So, I modified the .java file, and compiled it to get my new class file.
And the question is, how do I modify the existing file, so that I keep everything the same, except the modified class?
Thanks
Fernando
 
Ranch Hand
Posts: 1066
2
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Huh?
Confusing question. You can just run your class file(s) if you want. If you want a jar file you need to recreate it everytime you change any code which lives in it.
 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use your favorite zip compression utility - i.e WinZip or PKZip. Jar files are just zip files and packages like WinZip are much easier to use for replacing files within the Jar.
 
Fernando Sanz
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Tom Blough:
Use your favorite zip compression utility - i.e WinZip or PKZip. Jar files are just zip files and packages like WinZip are much easier to use for replacing files within the Jar.


I've just tried so, but it doesn't seem to work
In case this help to understand what I'm trying to do:
My idea was to modify the Swing package so that I could use it in my PDA. This way I could test the speed of my existing applications without having to rewrite the code to be compatible with Personal Java.
Thanks guys
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!