Illegal UTF8 string in constant pool in class file

Refresh

6 days ago

Views

7.1k time

1

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: http://www.test.world2build.com/Game/Play.aspx

The code for this applet can be found here:

http://www.test.world2build.com/Game/Applet.txt

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

4 answers

1

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

0

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

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

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

2

(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...

1

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!.