Originally posted by prasanna sheregar: one more doubt, suppose i have A.class,B.class and C.class in a single JAR file which has name XYZ.jar then how can i get only A.class file back
JAR files are a special kind of ZIP files. Using a ZIP application, such as WinZip, TugZIP or Windows XP's built in unpacker, you can easily extract any file from a JAR file.
one more doubt, can we get the java Source code back from a single .Class File?
The original source? No. For instance, all comments will be removed, and sometimes the compiler optimizes code.
Some decompilers do a good enough job though. I've used JADNT in the past with some good result. Still, it is never a replacement for having the original source.
It is also possible to obfuscate compiled code. If this has occurred it is hard, if at all possible, to retrieve its source code.
Final note: decompiling Java classes (or any program for that matter) can be illegal, depending on both the country and the origin of the compiled code. [ November 20, 2007: Message edited by: Rob Prime ]
Simply speaking, its possible through 'Decompilation' through some tools like JAD.
But you got a detailed explanation by Rob.
Joined: Jan 29, 2003
A jar is often a "unit of deployment", a bundle of related code that should be released together. In a large system we might find different subsystems and frameworks divided into different jars. And in some environments it is important to be able to deploy one new jar without updating all the others.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi