I want to develop an application where i want to add a item on menubar But depending on the mode(debug mode or normal mode).In test mode the item should be visible and if the application is running in normal mode than item should not be visible.
public static final boolean DEBUG = (System.getProperty("osgi.dev") != null);
So far i found something like this which could tell whether the application is debug mode or not but however this trick is not working. It is returning true always irrespective of debug mode and normal mode .Any pointer regarding this will help me.
In your debug launch config, add a java system property to VM arguments (on the Arguments tab). This would be something like -Ddebug=true
. Then your code can call System.getProperty("debug")
and test for the String "true" (actually, any non-null value). If getProperty()
returns null, you know that you're not running from your debug launch config.