As java programmer know that program made under java are converted to jar file for usage... And an updation in any class require that jar to be updated. So is there any way that we can update the class file at runtime rather then whole jar file. I want to provide update facility to user.

Recommended Answers

All 4 Replies

don't do that, you have to calculate with byte lenght in compiled code, in Java this warnigs starting if you received error about Incompatible magic value, and another ZOO,

but in other hands if you'll will learn more about PL's, then you'll able to change all variables declared (valid for majorities of PL) as String someString = "SomeValue";

way that we can update the class file at runtime rather then whole jar file. I want to provide update facility to user.

Are you looking for a utility to replace a class file that is in a jar file with another version of that class file?
I haven't seen one, but I did see a post on a forum somewhere where the OP was trying to write just such a utility.

@NormR1, Is there any utility which can change the class file in jar during runtime? Can u please post the link
@mKorbel sorry i didnt get your second line.

I don't know if you can change a jar file while executing a class that is contained in that jar file. There could be a problem.
I have no idea if the OP that was working on his utility got it to work.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.