How to run ScenicView as Java agent in IntelliJ project?
I added ScenicView to my JavaFX application in IntelliJ using the following VM argument -javaagent:/full/path/to/ScenicView.jar
as suggested at http://fxexperience.com/scenic-view/help/ .
However, when I start the application, I get an exception java.lang.IllegalArgumentException: URI is not absolute
along with a few others and as a result, ScenicView will never be able to detect my application.
What could be wrong?
source to share
I saw in the documentation that ScenicView requires it to tools.jar
be accessible from the JDK on the classpath.
It turns out IntelliJ only loads JRE libraries on the classpath, even if you point to the full JDK as SDK. I added tools.jar
from JDK to classpath in Module Settings -> SDKs -> Classpath
.
After this little fix, everything works as expected.
source to share