Illegal UTF8 string in constant pool in class file

2019-07-28 12:02发布

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.

标签: java utf-8
4条回答
我想做一个坏孩纸
2楼-- · 2019-07-28 12:08

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

查看更多
一纸荒年 Trace。
3楼-- · 2019-07-28 12:24

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

查看更多
【Aperson】
4楼-- · 2019-07-28 12:32

This happened to me when a ubuntu laptop powered down during n SBT project compile in IntelliJ.

"Illegal UTF8 string in constant pool in class file org/apache/spark/ml/linalg/DenseMatrix"

The solution was to restart the laptop then do a invalidate/cache restart.

查看更多
Ridiculous、
5楼-- · 2019-07-28 12:33

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

查看更多
登录 后发表回答