Illegal UTF8 string in constant pool in class file


6 days ago


7.1k time


I am trying to make a Java applet for my website. I'm having major issues getting it to work.

I get this error: Illegal UTF8 string in constant pool in class file

You can see this error here:

The code for this applet can be found here:

This applet was exported as a Jar in Eclipse, and uploaded to my website via CoffeeCup Direct FTP.

4 answers


illegal utf8 in constant pool class format error.... this java error tired me. ı could not solve it for several weeks in mac. finally found the way mac>preferences>java>genral>settings>delete files>default settings was the solution


Это случилось со мной, когда убунту ноутбук обесточена н SBT проекта компилировать в IntelliJ.

«Нелегальная строка UTF-8 в постоянном пуле в файле класса орг / Apache / искрой / мл / linalg / DenseMatrix»

Решение было перезагрузить ноутбук, то сделать рестарт Invalidate / кэша.


(EDIT: The jar file on the server has now changed...)

It's hard to help without any background, code etc.

Given that the jar file itself is invalid (I've just downloaded it and tried to open it) I suspect you did something like uploading it to your hosting provider in ASCII instead of BINARY mode.

If my psychic debugging powers have failed this time (and this was really stretching them) I strongly suggest you give us more information - importantly:

  • How did you build your jar file?
  • Does your jar file work locally?
  • How have you uploaded it to your hosting provider?

Looking at the jar file with a hex editor, it appears to have some Java source code in it in plain text - uncompressed which would be somewhat odd in a jar file. It also doesn't open as a valid zip file...


I have faced similar issue while running command gradle clean build in my spring boot project. I have just restarted my laptop. Then problem solved!.