aragozin/jvm-tools

Wrong usage of Java home

timber-they opened this issue · 1 comments

When calling the program, e.g.

 java -jar sjk.jar hh -p 12556

the first output is:

Java home points to C:\Program Files\Java\jre1.8.0_202 make sure it is not a JRE path

However, my JAVA_HOME variable is set as follows (result of set JAVA_HOME):

JAVA_HOME=C:\Program Files\Java\jdk1.8.0_202

So apparently the tool uses some other Java home, which I don't know how to change. I'd suggest to use the value of the JAVA_HOME environment variable instead. Currently I am unable to use the tool at all.

I downloaded the newest version using wget https://bit.ly/2H3Uqck -O sjk.jar. My OS is Microsoft Windows 10 Pro (Version: 10.0.19042 Build 19042) and I tried cmd and Powershell. Please let me know if you need any further information.

I had the same issue, in our case we have a locked down environment where I would have to install openjdk-devel instead of just openjdk (only includes JRE not tools which is required for sjk), but since it's locked down I would have to request an install and wait X days/weeks. What I did was just install openjdsk-devel locally and copy it to target server then specify the entire path for java when running, like this:

$ /opt/druid/sjk-profiling/java-1.8.0-openjdk-1.8.0.332.b09-2.el8_6.x86_64/bin/java -jar sjk.jar stcap -p 3692004 -o druid-3692004-overlord.std -t 30s -i 50ms

Writing to /opt/druid/sjk-profiling/druid-3692004-overlord.std
Collected 651
Collected 1085
Collected 1519
...