Illegal UTF8 string in constant pool in class file

左心房为你撑大大i 提交于 2020-01-16 02:04:47

问题


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.


回答1:


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




回答2:


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




回答3:


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




回答4:


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.



来源:https://stackoverflow.com/questions/9673511/illegal-utf8-string-in-constant-pool-in-class-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!