---
title: "WARNING: JMockit was initialized on demand, which may cause certain tests to fai"
author: "zerostar88"
date: "2013-08-05T09:04:30Z"
tags: []
categories: ["编程语言"]
slug: "warning-jmockit-was-initialized-on-demand-which-may-cause-certain-tests-to-fai"
draft: false
lastmod: "2013-08-05T09:04:30Z"
id: 1920034
url: "https://jeffyding.iteye.com/blog/1920034"
---

When we using Jmokit and Junit, it will show following warning when runing test cases in Eclipse:

 

*WARNING: JMockit was initialized on demand, which may cause certain tests to fail;*  
*please check the documentation for better ways to get it initialized.*

 

Solution:

Add following in JVM arguments

***-javaagent:{Jmokit file location}/jmockit-0.999.19.jar***