Java调试问题记录
问题1. No enclosing instance of type ReenterLockTest is accessible. Must qualify the allocation with an enclosing instance of type ReenterLockTest (e.g. x.new A() where x is an instance of ReenterLockTest).
问题原因:
在一个静态成员中引用非静态成员。
解决方法:
增加static修饰,改为静态成员。
问题2:he method of type must override a superclass method
问题原因:
项目使用JDK版本过低
解决方法:
step1.按eclipse的Windows->Preferences->Java->Compiler “configure project specific settings”, Change from java 1.5 (5.0) to 1.8 (6.0)
step2: 修改eclipse的 Compiler level: window —> preferences–>java -->Compiler
把Compiler compliance level 修改为1.8
step3:目右键->build path->configure build path->java Compiler :Compiler compliance level 修改版本为 1.8.
问题3:配置了私有库 经常会遇到执行mvn命令的时候,会提醒:“Downloading: http://repo.maven.apache.org/maven2/”
参考这个博客
解决办法:
在项目pom.xml中添加如下配置:
<repositories>
<repository>
<id>central</id>
<url>http://host:port/content/groups/public</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://host:port/content/groups/public</url>
</pluginRepository>
</pluginRepositories>、