aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes About javac -g option Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "About javac -g option" Watch "About javac -g option" New topic
Author

About javac -g option

Rashid Mian
Ranch Hand

Joined: Feb 14, 2007
Posts: 31
Can any body tell me with example how to use -g option and -verbose option.
What are there uses using command line shell.
Infact as we people normally use GUI based IDE and we use breakpoints there for debugging, I am wondering if this breakpoints are also possible using command line javac( is this -g what for?)
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42599
    
  65
Using "-g" will cause debugging information to be included in the class file, e.g. the real names of fields, and line number information.

You can find out easily what "-verbose" does by running the same program from the command line with and without it.


Ping & DNS - my free Android networking tools app
Rashid Mian
Ranch Hand

Joined: Feb 14, 2007
Posts: 31
Thouge I understand verbose usage, but i tried -g option with/without, and found no difference in class file. Why is that so?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42599
    
  65
The debugging information in contained in the class file; it makes no difference to running the program. If you compare the files generated with and without the "-g" option you'll see that they differ.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About javac -g option