Check if aspectjweaver (or any javaagent) is loaded
问题 Is there a (pref portable) way to check if The JVM has been stated with a particular -javaagent ? In particular I'm interested to know if the aspectj load time weaver has loaded or not. (I'm trying to provide a helpful error msg in the case of incorrect startup). 回答1: The following code shows a way to determine any -javaagent:... JVM arguments, a way to check if the AspectJ weaving agent entry point class (the one mentioned in the manifest entry Premain-Class: of aspectjweaver.jar ) is loaded