关于eclipse软件中jar打包后创建对象出错的问题---Exception in thread “main“ java.lang.Error: Unresolved compilation....

时间:2024-03-27 16:21:30

报错:Exception in thread “main” java.lang.Error: Unresolved compilation problems:
Animal cannot be resolved to a type
Cat cannot be resolved to a type

解决方案:
1.删除module-info.java
关于eclipse软件中jar打包后创建对象出错的问题---Exception in thread “main“ java.lang.Error: Unresolved compilation....
2.将jar包解压

3.找到classpath和project文件,将其复制到你创建的工程上
关于eclipse软件中jar打包后创建对象出错的问题---Exception in thread “main“ java.lang.Error: Unresolved compilation....
4.在随后的提示中选择:
关于eclipse软件中jar打包后创建对象出错的问题---Exception in thread “main“ java.lang.Error: Unresolved compilation....
5.接着点Overwrite All,最后右键jar重新build path即可