Eclipse :无法生成串行版本ID
我有一个关于Eclipse 3.6(Helios)的问题:
每当我想为扩展类的类生成串行版本ID()时,我都会收到以下消息:serialVersionUID
serializable
出现以下错误: 找不到类文件。确保文件是可编译的。
我做错了什么?
谢谢。
我有一个关于Eclipse 3.6(Helios)的问题:
每当我想为扩展类的类生成串行版本ID()时,我都会收到以下消息:serialVersionUID
serializable
出现以下错误: 找不到类文件。确保文件是可编译的。
我做错了什么?
谢谢。
就我而言,我通过以下方式解决了这个问题:
右键单击项目,“生成路径” - > “配置生成路径” - > “源” 选项卡,删除标记为“缺少”的路径。
有时,一个工具(例如AspectJ - AJDT或其他工具)会删除项目的Java性质,并且它不会编译,而不会在编辑器上显示任何错误。
检查您是否有一个包含两个条目的 .project 文件:org.eclipse.jdt.core.javabuilder 和 org.eclipse.jdt.core.javanature
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Myproject</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<!-- This one is required -->
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<!-- This one is required too -->
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>