Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About javac -g option

 
Rashid Mian
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rashid Mian
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic