I found it out myself now:
boolean isDebug = java.lang.management.ManagementFactory.getRuntimeMXBean().
getInputArguments().toString().indexOf("jdwp") >= 0;
This will check if the Java Debug Wire Protocol agent is used.
More Related Contents:
- Eclipse java debugging: source not found
- Break when exception is thrown
- JBoss debugging in Eclipse
- How to use conditional breakpoint in Eclipse?
- Eclipse – debugger doesn’t stop at breakpoint
- Locally declared variables can not be inspected
- Viewing complete strings while debugging in Eclipse
- How do I deal with a ClassNotLoadedException while debugging?
- Eclipse logcat debugging
- Eclipse debugging “source not found”
- Java object ID in jvm
- Determine if a java application is in debug mode in Eclipse
- Can I find out the return value before returning while debugging in Eclipse?
- Running a program in Debug mode is incredible slow
- How to detect when a variable changes value
- Where do you configure Eclipse Java compiler (javac) flags?
- How to Use Eclipse to Debug JNI code (Java & C/C++)
- Breakpoint at exception in Eclipse – how to examine Exception object?
- Best way to debug Java web application packaged as a WAR using Eclipse and Maven?
- Why does the Eclipse debugger give the error “Source not found” seemingly without reason?
- What different breakpoint icons mean in Eclipse?
- Attach debugger to application using Eclipse
- WindowBuilder Design Tab incomplete in Eclipse
- how do I get eclipse to use a different compiler version for Java?
- What causes imported Maven project in Eclipse to use Java 1.5 instead of Java 1.6 by default and how can I ensure it doesn’t?
- No color highlight in Eclipse in some files
- maven-archetype-webapp eclipse problem
- Find unused classes in a Java Eclipse project
- R.raw.anything cannot be resolved [duplicate]
- Why “no projects found to import”?