Bangladeshi Softwares
Home - Download - Codes & Tutorials - Bangla IT Bibhag - Mobile - About Me

 


Decreasing class file size in Java


Step-1:
Generally we use the command javac SourceFileName.java to compile our source files in Java. By default, this command adds some debugging info to our compiled class files, which makes the size of the class files bigger. It also takes more time to load, when we execute them with the java command. You do not need these debugging info normally, unless you use a debugger to debug them. So, remove all unnecessary debugging info by recompiling your source files before you distribute your programs written in Java with this command javac -g:none SourceFileName.java. However, if you want to include all the debugging info into your compiled class files, use this command javac -g SourceFileName.java. You can also pass an extra parameter to the compiler to see what is going on in the background. The parameter is -verbose. See the output below:




Other Helpful Resources:
http://java.sun.com
http://javaboutique.internet.com



 



©Ahsanul Haque Shovon
All rights reserved