IntelliJ中类文件错误中常量池中的非法UTF8字符串

时间:2015-05-15 14:08:32

标签: java intellij-idea

每当我尝试运行文件(java main,黄瓜功能,junit测试)时,我在IntelliJ Idea中收到以下错误:

    Information:15/05/2015 14:57 - Compilation completed with 1 error and 0 warnings in 1s 134ms
Error:Internal error: (java.lang.ClassFormatError) Illegal UTF8 string in constant pool in class file org/jetbrains/jps/model/serialization/java/JpsJavaModelSerializerExtension$JavaProjectExtensionSerializer
java.lang.ClassFormatError: Illegal UTF8 string in constant pool in class file org/jetbrains/jps/model/serialization/java/JpsJavaModelSerializerExtension$JavaProjectExtensionSerializer
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at org.jetbrains.jps.model.serialization.java.JpsJavaModelSerializerExtension.getProjectExtensionSerializers(JpsJavaModelSerializerExtension.java:80)
    at org.jetbrains.jps.model.serialization.JpsProjectLoader.loadFromDirectory(JpsProjectLoader.java:118)
    at org.jetbrains.jps.model.serialization.JpsProjectLoader.loadProject(JpsProjectLoader.java:98)
    at org.jetbrains.jps.model.serialization.impl.JpsSerializationManagerImpl.loadModel(JpsSerializationManagerImpl.java:41)
    at org.jetbrains.jps.cmdline.JpsModelLoaderImpl.loadModel(JpsModelLoaderImpl.java:45)
    at org.jetbrains.jps.cmdline.BuildRunner.load(BuildRunner.java:78)
    at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:265)
    at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:124)
    at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:242)
    at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:41)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)

我尝试重新启动IDE,再次导入项目但没有任何效果。之前有没有人遇到过这个错误?

1 个答案:

答案 0 :(得分:0)

我已设法通过删除.IntelliJIdea文件夹并重新导入项目来解决此问题。