jvm-profiling-tools / ap-loader

Packages async-profiler with binaries for all platforms in a single JAR
Apache License 2.0
130 stars 10 forks source link

basic docs on jbang usage #9

Closed maxandersen closed 1 year ago

maxandersen commented 1 year ago

here is a readme documenting how to use ap-loader jbang alias.

I would still encourage to create jvm-profilng-tools/jbang-catalog then instead of:

jbang ap-loader@jvm-profiling-tools/ap-loader it would just be jbang ap-laoder@jvm-profiling-tools.

But anyhow - here is the doc for how it works with the alias inside the main repo.

maxandersen commented 1 year ago

Hmm. How did you install it?

I think you hit the issue that someone (not me) submitted a bad formula to the main brew repo. Make sure to use one of the installs documented at jbang.dev/downloads

parttimenerd commented 1 year ago

I used brew, but now I used the sdkman version, but after installing, the javaagent still did not work:

> java -javaagent:ap-loader@jvm-profiling-tools/ap-loader=start,event=cpu,file=profile.html -jar ~/Downloads/ap-loader-2.8.3-all.jar
Error opening zip file or JAR manifest missing : ap-loader@jvm-profiling-tools/ap-loader
Error occurred during initialization of VM
agent library failed to init: instrument

Any ideas? Being able to use ap-loader directly is really cool.

maxandersen commented 1 year ago

you need to follow the docs and use jbang not java :)

This should do it:

jbang --javaagent:ap-loader@jvm-profiling-tools/ap-loader=start,event=cpu,file=profile.html ~/Downloads/ap-loader-2.8.3-all.jar

parttimenerd commented 1 year ago

I will merge it and modify the text afterward to fix the other issues I pointed out myself.