《交个朋友,绝非潘嘎之交》


在使用Java脚本语言javax.script包时,项目报错,报错内容如下:

Usage of API documented as @since 1.6+ This inspection finds all usages of methods that have @since tag in their documentation. This may be useful when development is performed under newer SDK version as the target platform for production

**问题解决方法:**打开工程配置,修改language level为6以上的版本即可
File ->Project Structure->Project Settings -> Modules -> (需要修改的工程名称) -> Sources -> Language Level->选6以上的版本。

到这里问题已经解决了,想继续了解问题根源的同学请继续:

首先分析报错信息,这是由于使用了当前开发环境无法解析的jdk特性,javax.script是Java6中加入的新特性,可能当前开发环境版本较低。
打开工程的属性设置窗口(Ctrl+Alt+shift+S):

目前的JDK版本是1.7,这没毛病,下面的language level也是选择了和JDK版本一致的,但是为什么还会报错?接下来看下工程配置信息:

从这里可以看出工程的language level还是5.0,这也就解释了为什么使用javax.script会报错了,把这里的language level改成6以上的版本,确认后就OK了。

那么还有一个疑问,那就是我明明在项目配置中设置了language level为7,为什么到了module中就变成5了呢?

这里面就是项目和工程的区别了,在maven中每个工程有各自的pom.xml配置,如果不在pom.xml中进行配置的话,工程的language level默认为5,可以在pom中进行该项设置

<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.1</version><configuration><source>1.7</source><target>1.7</target><encoding>utf-8</encoding></configuration>
</plugin>

“Usage of API documented as @since 1.6+……”的解决办法相关推荐

  1. Intellij IDEA 出现“Usage of API documented as @since 1.7+”的解决办法

    具体报错内容如下: This inspection finds all usages of methods that have @since tag in their documentation.   ...

  2. Usage of API documented as @since 1.8+ less... (Ctrl+F1) Inspection info: This inspection finds all

    1.不知道小伙伴们在日常开发过程中使用stream流的时候,有没有遇到这样的情况, 发现stream()方法是红色的 , 这是编译工具提醒的, 估计是出现了什么问题, 如下图所示: 2.当我们把鼠标移 ...

  3. Arrays.copyOf 编译器提示 Usage of API documented as @since 1.6+ less... (Ctrl+F1) This inspection finds

    一.问题引出 使用 Arrays.copyOf(int[],length)方法是 编译器提示 Usage of API documented as @since 1.6+ less- (Ctrl+F1 ...

  4. Usage of API documented as @since 1.9+ less... (Ctrl+F1) Inspection info: This inspection finds all

    问题如下: Usage of API documented as @since 1.9+ less- (Ctrl+F1) Inspection info: This inspection finds ...

  5. “Usage of API documented as @since 1.8+”报错的解决办法

    出现如图错误: 报错信息: Usage of API documented as @since 1.8+ This inspection finds all usages of methods tha ...

  6. Usage of API documented as @since 1.9+

    Usage of API documented as @since 1.9+ idea爆红提醒: Usage of API documented as @since 1.9+ 提醒需要1.9版本以上的 ...

  7. Error: Google Play requires that apps target API level 26 or higher. 两种解决办法

    这个问题是Android Studio和SDK升级后出现的,在编译Release版本的时候报错.两种解决办法:1)在targetSdkVersion 上面一行加注释://noinspection Ex ...

  8. “Usage of API documented as @since 1.8+”

  9. idea报“Usage of API documented as @since 1.7”这一问题的解决方法

    https://blog.csdn.net/weixin_42687829/article/details/86751174

最新文章

  1. java负载均衡框架_SpringCloud与Consul集成实现负载均衡功能
  2. 课时 25:Kubernetes 网络模型进阶(叶磊)
  3. ubuntu16.04安装cuda8./9.
  4. Python二级基础知识点
  5. 1.4编程基础之逻辑表达式与条件分支 09判断能否被3,5,7整除(2021.12.05)
  6. python thread 共享数据
  7. 老司机带你用 Go 语言实现 MapReduce 框架
  8. 推荐:没有项目经验,可以读一下这几个开源的企业级项目...
  9. 解决方法:Linux装完显卡驱动后分辨率显示不正常
  10. python内置函数程序_Python入门,一定要吃透这69个内置函数
  11. java程序员模版_45套java程序员简历模板
  12. Vue3项目中使用AE+bodymovin+lottie的模式制作特效
  13. MATLAB简介与桌面系统
  14. 广东石油化工学院大学计算机基础,落实广东石油化工学院关于公布2013年度实验课题项目的通知...
  15. 设置android模拟器的ip地址,设置Android模拟器IP地址
  16. Creator Kit: Beginner Code Unity学习记录 (1)
  17. ExtJS实战教程~~前言
  18. python生成简单二维码_使用Python生成个性二维码
  19. 文本编辑器,选什么好
  20. Python|自制二维码生成器

热门文章

  1. DataX学习笔记-Reader插件开发
  2. linux清空网络错误包,centos – 删除包时PREUN scriptlet中的yum错误
  3. ggplot作图(条形图 误差线点图 折线图 箱线图 密度图 岭图 小提琴图 云雨图 直方图 PCA图 PcoA图 NDMS图 和弦图 维恩图 时间序列图 系统发育树 饼图 生物区系图 地图 )
  4. ASCII文件与二进制文件
  5. ubuntu使用python读串口_Win10的Linux子系统Ubuntu使用串口
  6. 在研究所月入两万,是一种什么体验?
  7. MAC OS X下批量转换png为pvr.ccz 简易脚本
  8. python 语音转文字_python使用科大讯飞语音合成文字转语音
  9. 学好小学奥数必懂的解题思路 建议家长帮孩子收藏
  10. 前端 - JavaScript(基础语法)