0

error message while building project

Getting below error in eclipse 2021-12 while building project

Errors occurred during the build.
    Errors running builder 'Java Builder' on project 'xxx'.
    Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @536d97f8
    Errors running builder 'Maven Project Builder' on project 'xxx'.
    java.lang.IllegalArgumentException: Malformed \uxxxx encoding.

I am using JDK 1.8

I tried deleting project, restarting eclipse and also re-installing JDK.

I tried adding below VM arguments but not worked

enter image description here

EDIT:

I see lombok is causing this issue

-(Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @536d97f8 Errors running builder 'Maven Project Builder' on project 'xxx'.)

After installing lombok to eclipse IDE the issue got resolved.

But still I am getting below error while building - java.lang.IllegalArgumentException: Malformed \uxxxx encoding.

enter image description here

I see answers for same error but its the issue with Ant and its giving error for maven. I don't see any path where "\" is used in project/POM. Ant: Malformed \uxxxx encoding in propertyfile task

EDIT 2:

java.lang.IllegalArgumentException: Malformed \uxxxx encoding.

Above issue resolved after following below solution (it has step to step guide to fix the error) Solution

Karan Chavan
  • 13
  • 1
  • 6
  • 1
    Your error shows that you are not using JDK 1.8 but at least JDK 9. It indicates that you cannot make methods from the `java.base` module accessible. – Rob Spoor Feb 07 '22 at 10:12
  • Do you have lombok or aspectj installed in Eclipse? Bug reports suggest they can cause this – greg-449 Feb 07 '22 at 10:41
  • @greg-449 Yes greg I see lombok is causing the issue. After in installing lombok to eclipse IDE the issue got resolved. Thanks But still I am getting error while building - java.lang.IllegalArgumentException: Malformed \uxxxx encoding. – Karan Chavan Feb 07 '22 at 12:09
  • I see one bug report for something like that [here](https://bugs.eclipse.org/bugs/show_bug.cgi?id=574316) but I have no idea if that is your issue. – greg-449 Feb 07 '22 at 12:30
  • I see the bug report is same the error I am facing. It seems, they didn't got any proper solution yet. I tried by updating maven to 3.8.4 but not worked for me. Thanks @greg-449 – Karan Chavan Feb 07 '22 at 13:07
  • Does [running your Eclipse 2021-12 with Java 11 or 15](https://wiki.eclipse.org/Eclipse.ini#Specifying_the_JVM) (instead of the Java 17 that is included in Eclipse) fix your issue? Java 17 is more restrictive which might cause this accessible error shown in your first screenshot. – howlger Feb 07 '22 at 15:25
  • The first issue (java.lang.ClassFormatError accessible) is got resolved after istalling lombok to eclipse - (using jdk 8) – Karan Chavan Feb 08 '22 at 08:18
  • [link](https://stackoverflow.com/questions/68003423/java-lang-illegalargumentexception-malformed-uxxxx-encoding-while-mvn-install#:~:text=To%20find%20which%20file%20is%20malformed%20(as%20to%20not%20have%20to%20delete%20your%20entire%20Maven%20repository)%20you%20can%20debug%20it%20like%20so%3A) Above solution has a step to step guide to fix the issue. ` java.lang.IllegalArgumentException: Malformed \uxxxx encoding` – Karan Chavan Feb 08 '22 at 11:05

1 Answers1

1
java.lang.IllegalArgumentException: Malformed \uxxxx encoding.

Above issue resolved after following below solution (it has step to step guide to fix the error)

Solution

Karan Chavan
  • 13
  • 1
  • 6