I get AttachNotSupportedException while running jmockit tests on linux (ubuntu 64bit). Java version is 1.7.0_51. This JDK is from Oracle. Tests are run using
Like @bbarker, I got the same error but on JDK 1.8.0_161 using the Linux subsystem in Windows 10 ("Bash on Ubuntu on Windows"). Configuring the Surefire plugin with the JVM argument mentioned above fixed the issue for me as well:
org.apache.maven.plugins
maven-surefire-plugin
2.21.0
-XX:+StartAttachListener
Running the tests from a "normal" Windows command prompt works without the above, though.