关于IDEA:idea常见的bug

11次阅读

共计 1326 个字符,预计需要花费 4 分钟才能阅读完成。

java: 源值 1.5 已过期

> java: 源值 1.5 已过期, 将在将来所有发行版中删除
> java: 要暗藏无关已过期选项的正告, 请应用 -Xlint:-options。

https://blog.csdn.net/IT_laob…

起因:

这是因为 maven 默认的编译环境是 JDK1.5,只须要在 xml 中退出 <properties> 属性,属性中增加 maven.compiler.source 和 maven.compiler.target 即可。

解决办法:

<groupId>com.itdemo</groupId>
<artifactId>es-first</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
</properties>

java: 程序包 xxxx 不存在

https://blog.csdn.net/weixin_…

解决办法:

1. 点击 file––>invalidate caches

2. 应用 idea 首页面的 import,从新导入你的我的项目

not found

个别呈现这个报错信息,是指编译好的文件里没找到 xx 文件,maven 我的项目的编译文件都输入在这里 target 文件夹
咱们能够去 target 文件夹查看报错信息中显示没有找到的文件是否存在

遇到过的报错信息

artifacts

\out\artifacts not found for the web module

java – Using Intellij to Build War and Deploy to Tomcat – Stack Overflow

起因:

点击 Project structure —> Artifacts

发现 output directory 显示为“根目录 /out”(这可能是因为我手动生成的 war 包,而后 idea 默认门路是根目录 /out)

但问题就是,maven 我的项目的输入门路在 target 文件夹,所以咱们要改成根目录 /target
解决办法
将 output directory 改为 根目录 /target

No MyBatis mapper was found

> org.mybatis.spring.mapper.ClassPathMapperScanner.doScan No MyBatis mapper was found in[com.xxx.dao]

起因:

首先,查看了 sping 和 mybatis 配置文件和注解都完全正确,甚至还把原我的项目的代码复制进去,还是报错,把 target 文件删除再 compile 就不报错了,所以是 idea 编译的锅。

前面我改了下 pom.xml 文件,rebuild 后,又呈现同样的起因,而后去 target 文件夹查看,的确 dao 包里只有 xml 文件,没有 dao.java 文件。
花了三个小时才发现起因,呵呵。。。

解决办法:

  1. 能够 clean or 删除 target 文件后 再 compile
  2. 还是呈现雷同的报错,则表明我的项目自身代码或者配置文件出错
    正确的 dao 包里 class 和 xml 文件都有

正文完
 0