Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying name of class that contains main

 
Pete Hitchman
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am writing a java application and I am checking the number of arguments passed on the
command line and if this fails printing out a
usage message. I would like the usage message
to include the name of the class that contains
the main method. How do I access this information?
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this

Rene
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are WRITING the app . . .

(I must be missing something here . . . )
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
or if you want to get the Class name from a method other then a static one:

Rene
 
Pete Hitchman
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks people.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic