3

Possible Duplicate:
Determine if a java application is in debug mode in Eclipse

I can start a java program in eclipse by run as or debug as.

Is there any way in the java code to check if it was started by run or debug? I want to do something(e.g. reloading resource) when it's in debug mode only.

Community
  • 1
  • 1
Freewind
  • 193,756
  • 157
  • 432
  • 708

1 Answers1

1

Is really eclipse who does the magic, by launching the jvm in debug mode which opens a tcp port to attach a debugger so, if you wish to check if you're in debug mode you'd probably want to check if that port is taking connections, at least is one way I can think of.