Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7590153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:20:08+00:00 2026-05-30T20:20:08+00:00

When trying to run test with JMockit on OpenJDK 6, I’m facing the error:

  • 0

When trying to run test with JMockit on OpenJDK 6, I’m facing the error:

[junit] Exception in thread "main" java.lang.ExceptionInInitializerError
[junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:353)
[junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1052)
[junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:906)
[junit] Caused by: java.lang.IllegalStateException: Native library for Attach API not available in this JRE
[junit]     at mockit.internal.startup.JDK6AgentLoader.getVirtualMachineImplementationFromEmbeddedOnes(JDK6AgentLoader.java:81)
[junit]     at mockit.internal.startup.JDK6AgentLoader.loadAgent(JDK6AgentLoader.java:54)
[junit]     at mockit.internal.startup.AgentInitialization.initializeAccordingToJDKVersion(AgentInitialization.java:21)
[junit]     at mockit.internal.startup.Startup.initializeIfNeeded(Startup.java:200)
[junit]     at mockit.internal.startup.Startup.initializeIfPossible(Startup.java:215)
[junit]     at junit.framework.TestResult.<clinit>(TestResult.java:19)
[junit]     ... 3 more
[junit] Caused by: java.lang.UnsatisfiedLinkError: sun.tools.attach.LinuxVirtualMachine.isLinuxThreads()Z
[junit]     at sun.tools.attach.LinuxVirtualMachine.isLinuxThreads(Native Method)
[junit]     at sun.tools.attach.LinuxVirtualMachine.<clinit>(LinuxVirtualMachine.java:364)
[junit]     at mockit.internal.startup.JDK6AgentLoader.getVirtualMachineImplementationFromEmbeddedOnes(JDK6AgentLoader.java:71)
[junit]     ... 8 more

I looked inside folder /usr/local/openjdk6/jre/lib/amd64/ and found libattach.so there

However adding -Djava.library.path=/usr/local/openjdk6/jre/lib/amd64 didn’t solve the problem. What else I can try?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T20:20:09+00:00Added an answer on May 30, 2026 at 8:20 pm

    Try adding <jdk6home>/lib/tools.jar to the classpath, before jmockit.jar. If that doesn’t solve the problem, passing -javaagent:jmockit.jar as a JVM initialization parameter definitely should.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to run a particular JUnit test by hand on a Windows XP
I am trying to run JUnit test with a 1.5 JRE, but get the
I'm trying to run Jettys ServletTester in my JUnit test. I created a simple
Trying to run a java test using bluecove, I got: Native Library bluecove_x64 not
I'm trying to run some JUnit test units in Eclipse 3.5, but with no
I am new to Java and am trying to run a unit test on
I'm trying to run a test that written by another programmer with JUnit in
I am trying to run android instrumentation Junit test using command line.I am using
I'm trying to run JUnit4 test cases on Eclipse 3.4.2 but it's not even
I'm trying to run a test version of a web using the File System

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.