jvm-profiling-tools / honest-profiler

A sampling JVM profiler without the safepoint sample bias
https://github.com/RichardWarburton/honest-profiler/wiki
MIT License
1.25k stars 146 forks source link

does not work with java 11 #283

Open agsha opened 10 months ago

agsha commented 10 months ago

I had to struggle a lot to build it and get it working with java11 When I finally ran my App with the attached java agent, it gave an error

agent library failed to init: /home/sharath/os/honest-profiler/cmake-build-release/build/liblagent.so
ERROR: JVMTI initialisation error -3

seems like this project is fundamentally broken for modern jdks

agsha commented 10 months ago

fro what its worth, attaching my patch file to compile this project patch.txt

Plz note, we have to build the c++ part separately

cmake
make -j6

you have to download open javafx from here https://gluonhq.com/products/javafx/ (i downloaded in /home/sharath/os/javafx-sdk-17.0.8/lib)

compile with regular mvn clean package

after that, you can start the GUI by running this command directly from target folder. (dont use the gui shell script)

java -cp honest-profiler.jar:/home/sharath/os/javafx-sdk-17.0.8/lib/ --module-path /home/sharath/os/javafx-sdk-17.0.8/lib --add-modules=javafx.controls --add-modules=javafx.graphics --add-modules=javafx.fxml -Djdk.attach.allowAttachSelf=true  com.insightfullogic.honest_profiler.ports.javafx.JavaFXApplication