【Eclipse】【2】遇到的问题

前言:

1,导入maven项目有红叉

2,pom.xml出错

3,debug启动老是跳转到断点,提示SilentExitException

4,编译没有class文件生成

5,报错,Access restriction: The type BASE64Decoder is not accessible due to restriction on required library 

6,报错,Project configuration is not up-to-date with pom.xml. Run Maven->Update Project or use Quick Fix

7,pom.xml错误,org.codehaus.plexus.archiver.jar.Manifest.write(java.io.PrintWriter)

8,.properties文件中文显示乱码

9,Eclipse导入项目:No projects are found to import

10,报错Unbound classpath container: 'JRE System Library [jdk17060]' in project **** 

 

正文:

1,导入maven项目有红叉

解决方法:右键项目 → maven → update project

参考博客:

eclipse导入maven项目有红叉及pom.xml出错的问题的解决 - Jennifer Bai - CSDN博客
https://blog.csdn.net/baijingfeng_1/article/details/79507931

 

2,pom.xml出错:error:Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:exec-maven-plugin:1.5.0:exec (execution: node, phase: compile)

解决方法:

方法1:命令行窗口:mvn clean → mvn eclipse:clean → mvn eclipse:eclipse

方法2:windows  → Preferences  →  Maven → Error/Warnings下Ignore掉这个 plugin execution错误

参考博客:

同1

 

3,debug启动老是跳转到断点,提示SilentExitException

 解决方法:Window  → Preference → Java → Debug,将“Suspend execution on uncaught exceptions”的勾去掉即可

参考博客:

eclipse debug启动老是跳转到断点,提示SilentExitException - 赖进杰的专栏 - CSDN博客
https://blog.csdn.net/ljj_9/article/details/79403729

 

4,编译没有class文件生成

解决方法:

(1)可能是自动编译没打开:project->build automatically

(2)注意你的工程项目上有没有打小红叉,项目报错时,eclipse是不自动编译的

(3)项目里引用不用的jar包,但该jar包已被删除

(4)关掉所有可能打开项目的程序,清除原有的class文件,clean一下,重新编译生成文件

(5)重新导入项目

注:其实一般都不是(1)(2),我是(4),不知道原来的class文件怎么了,偶尔会影响新的生成

参考博客:

Eclipse编译没有class文件生成 - 李鬼989 - 博客园
https://www.cnblogs.com/ligui989/archive/2013/10/09/3359979.html

 

5,报错,Access restriction: The type BASE64Decoder is not accessible due to restriction on required library 

编写Java代码时,用到了BASE64Decoder,import sun.misc.BASE64Decoder;编译报错

解决方法:

(1)在project build path中先移除JRE System Library,再重新添加回来,重新编译

(2)Windows → Preferences → Java → Compiler → Errors/Warnings → Deprecated and trstricted API → Forbidden reference (access rules):  → change to warning

注:我是用方法一解决的

参考博客:

sun.misc.BASE64Encoder找不到jar包的解决方法 - 天书夜读 - CSDN博客
https://blog.csdn.net/jbxiaozi/article/details/7351768

 

6,报错,Project configuration is not up-to-date with pom.xml. Run Maven->Update Project or use Quick Fix

解决方法:右键项目 → maven → update project

参考博客:

Project configuration is not up-to-date with pom.xml. Run Maven->Update Project or use Quick Fix - 无知人生,记录点滴 - CSDN博客
https://blog.csdn.net/testcs_dn/article/details/36461747

 

 7,pom.xml错误,org.codehaus.plexus.archiver.jar.Manifest.write(java.io.PrintWriter)

解决方法:在help → Install New Software → Work with中输入:https://otto.takari.io/content/sites/m2e.extras/m2eclipse-mavenarchiver/0.17.2/N/LATEST/

参考博客:

pom.xml错误,org.codehaus.plexus.archiver.jar.Manifest.write(java.io.PrintWriter) - MiniCTO - CSDN博客
https://blog.csdn.net/minicto/article/details/68923938

 

8,.properties文件中文显示乱码

解决方法:Windows → Preferences → General → Content Types → Java Properties File → *.properties 选择Default encoding为UTF-8格式

参考博客:

eclipse的.properties文件中文显示问题 - grpideas的专栏 - CSDN博客
https://blog.csdn.net/grpideas/article/details/46944969

 

9,Eclipse导入项目:No projects are found to import

解决方法:

首先查看项目目录中是否有隐藏文件.project和.classpath,没有的话:

(1)把其它项目的.project, .classpath文件拷贝过来

.project文件修改<name>AboxTVExchange</name>这个项目名称

.classpath文件通常不用改、

(2)将源码包移到非workspace目录下,然后new → project  →  create project from exist source

参考博客:

Eclipse导入项目:No projects are found to import - mcy478643968的专栏 - CSDN博客
https://blog.csdn.net/mcy478643968/article/details/19609113

 

10,报错Unbound classpath container: 'JRE System Library [jdk17060]' in project **** 

解决方法:

(1)在项目上单击鼠标右键 → Build Path → Configure Build Path 

(2)Java Build Path → Libraries → 删除错误的Libraries → Add Library → 选中JRE System Library → Next

(3)选择“alternate JRE”,如果下拉列表中没有,就点右侧的“Installed JREs”按钮添加,选择完成之后单击Finish按钮完成。

参考博客:

 

Unbound classpath container: 'JRE System Library [jdk17060]' in project *** - 无知人生,记录点滴 - CSDN博客
https://blog.csdn.net/testcs_dn/article/details/39637663

 

posted @ 2019-05-04 13:52  花生喂龙  阅读(307)  评论(0编辑  收藏  举报