aspose file tools
The moose likes Java in General and the fly likes Swapping a .class file out for another compiled from command line... Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Swapping a .class file out for another compiled from command line..." Watch "Swapping a .class file out for another compiled from command line..." New topic
Author

Swapping a .class file out for another compiled from command line...

Matt Kidd
Ranch Hand

Joined: Jul 17, 2002
Posts: 256
Okay. I've been wrestling this decompiled code to get this application to compile and run locally but the more errors I fix the more I uncover. Today it dawned on me I may or may not need to do this...

The particular piece I have to update seems insular and for the sake of this question I'll assume it is and insular meaning that while this piece of code is contained within the application the aspects it deals with are not immediately effecting other pieces save for the database.

The application is written for WebObjects and an older version at that not utilizing the current Project Wonder frameworks. In any case I've attempted to decompile the application and resulted in a mess that I mentioned above.

Would it be possible to compile from command line using javac to get the resulting .class using only the java file I need to make my changes?

Another way to think of this would be to say if you have 10 dependent files and you need to replace one, if it is compiled separately and then the resulting .class file replaces the one with the original 10 would the application still work?


Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3268

The answer is: Maybe

It depends on what public/protected code you change and if you're compiling with the same version of the JDK.


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Swapping a .class file out for another compiled from command line...
 
Similar Threads
Using annotation to put unique value in output
How can a Class create an instance of itself??
Need Help With Compiling Head First Java Code Examples
problem in executing swing application
Is there succint Eclipse setup HOWTO for compiling java?