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

Most upvoted comments

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 normally c:\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.

TEMP=c:\tmp image

This works on intellij ultimate 2019.2.4 and Windows 10.

One more solution: run idea64.exe as Administrator