How can a running Java program determine whether it is running from under Eclipse using the Run command (Ctrl + F11) or running under a JVM running from the command line separately from eclipse, such as `> java -cp myPath MyMainClass'?
1 answer
The Intelij Idea is added to System.getProperties ():
"idea.launcher.bin.path" with the value "C: \ Program Files (x86) \ JetBrains \ IntelliJ IDEA xxx \ bin"
Tested on Idea 2016.3 under JDK 1.8.0_102
If it doesn't matter to you, you can try the free Community Edition.
In Eclipse, unfortunately, this is not found.
- Thanks, but I just need eclipse. Idea is no good. - m. vokhm
|
System.getenv. - Suvitruf ♦