Maven build is successful but missing a dependency. JDWP exit error

j.seashell picture j.seashell · Jul 8, 2017 · Viewed 8.1k times · Source

[SOLVED] Sigh, just had to Project > Clean > Build. Using Run As > Maven build... was not having it.

I'm trying to use JavaPoet to build an enum based off annotations I've created, but I'm having trouble adding the Maven dependency. I resolve log4j2, H2, and Reflections dependencies successfully, but cannot resolve JavaPoet.

I'm having trouble finding any answers on what this FATAL ERROR is, any help is appreciated. I'm using Eclipse Neon.3, I don't have much RAM on my laptop -- only 4GB. Here is my Maven build output:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building My Project 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ MainClass ---
[INFO] Deleting C:\dev\git\MainClass\target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ MainClass---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ MainClass
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 90 source files to C:\dev\git\MainClass\target\classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.252 s
[INFO] Finished at: 2017-07-08T09:54:56-04:00
[INFO] Final Memory: 15M/169M
[INFO] ------------------------------------------------------------------------
FATAL ERROR in native method: JDWP on getting class status, jvmtiError=JVMTI_ERROR_WRONG_PHASE(112)
JDWP exit error JVMTI_ERROR_WRONG_PHASE(112): on getting class status [util.c:1285]

Answer

Tarun Kumar picture Tarun Kumar · Nov 24, 2017

I was also getting the same error in Eclipse IDE whenever I do the run maven goal clean install.

Build was successful but then displays below error.

JDWP exit error JVMTI_ERROR_WRONG_PHASE(112): on getting class status [util.c:1285]

But was surprised to see that the same maven goal was running perfectly outside eclipse in a command prompt.

To analyse further, in eclipse I opened the terminal window and ran below commands to know java compiler/vm versions

javac -version
java -version

and found that both was pointing to slight different versions.

Adding following lines in eclipse.ini file solved the issue.

-vm
C:\Program Files\Java\jdk1.8.0_91\bin\javaw.exe

Make sure you have add the above lines separately and above the following line

--launcher.appendVmargs
-vmargs

Refer this link for Setting the correct PATH for Eclipse and now

C:\Users\tarun.kumar2>java -version
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b15, mixed mode)

C:\Users\tarun.kumar2>javac -version
javac 1.8.0_91

I hope this helps you.