Re: Question about debugging .class file
- From: Thomas Hawtin <usenet@xxxxxxxxxxxxxxxxx>
- Date: Mon, 29 Aug 2005 09:54:24 +0100
George George via JavaKB.com wrote:
When debugging a C or C++ binary file, the file is different from the release version of binary file (debug version binary file is larger). My question is, if we want to debug a Java binary file (.class file), is the version of file (which we use to debug) the same as the file (which we are going to release)? If they are different, shall we add some additional options to compiler in order to make debug version binary file be different from release version binary file?
http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javac.html#options
You can strip the debug information with -g:none. -O used to do the same thing, but that appears to be gone.
It shouldn't make much difference to the performance if you leave debugging information in. Line numbers in particular can be handy to diagnose errors on production systems.
If you want to hide your code from decompilation, best use and obfuscator. There's lots of information left in the light compilation from source to byte code. Type names, field names, method names and most of the structure.
http://mindprod.com/jgloss/obfuscator.html http://mindprod.com/jgloss/decompiler.html
The real question: is size important to you. For both ye olde C++ on a floppy and Java applet I have come into a company and shrunk the binary considerably by switching off the default debug info. But if you're shipping to your own servers, on DVD or over broadband, size matters not.
Tom Hawtin -- Unemployed English Java programmer http://jroller.com/page/tackline/ .
- Follow-Ups:
- Re: Question about debugging .class file
- From: George George via JavaKB.com
- Re: Question about debugging .class file
- References:
- Question about debugging .class file
- From: George George via JavaKB.com
- Question about debugging .class file
- Prev by Date: SonyEricsson Bluetooth DEMO
- Next by Date: Problem with compiling files in a folder
- Previous by thread: Question about debugging .class file
- Next by thread: Re: Question about debugging .class file
- Index(es):
Relevant Pages
|