常见Java调试问题记录

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>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值