idea-jmh-plugin: Plugin doesn't work on Windows with IntelliJ 2016.1.1?
When running it seems like it tries to access an invalid path for its lock.
ERROR: org.openjdk.jmh.runner.RunnerException: ERROR: Exception while trying to acquire the JMH lock (C:\Windows\/jmh.lock): Access is denied, exiting. Use -Djmh.ignoreLock=true to forcefully continue.
at org.openjdk.jmh.runner.Runner.run(Runner.java:213)
at org.openjdk.jmh.Main.main(Main.java:71)
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 6
- Comments: 16 (5 by maintainers)
Commits related to this issue
- Fix artyushov#19 Exception while trying to acquire the JMH lock (C:\Windows\/jmh.lock): Access is denied — committed to joserobjr/idea-jmh-plugin by joserobjr 4 years ago
- Only inherit environment on Windows OS Limit the impact of inherited environment variables to Windows systems. This was/is a workaround for #19: non-Windows systems already properly provide the path ... — committed to knittl/idea-jmh-plugin by knittl 4 years ago
Or, alternatively, check the checkbox to include system defined environment variables in the environment variables dialog (opened via the “page icon” on the right side of the text box).
Not sure if this could have a negative impact on the benchmarks though …
java.io.tmpdir
on windows is normallyc:\Users\userName\AppData\Local\Temp
, so the JMH does not use this one. If it did, this directory is writable.@Jire You can add the TMP environment variable in the plugin configuration and point it to any writeable directory.
I also see this error. I am running the same version under Windows.
I can run benchmarks via gradle successfully (via jmh-gradle-plugin) - is it possible that they conflict?
@stokito I have created a follow-up MR to limit the impact of inheriting environment variables to Windows systems only: #40
See related, original MR https://github.com/knittl/idea-jmh-plugin/pull/1
In the “Run/Debug Configuration” dialog set the “Environment variables:” field to a writable directory e.g.
This works on intellij ultimate 2019.2.4 and Windows 10.
One more solution: run idea64.exe as Administrator