Idea报错: A JNI error has occurred
Idea报错环境异常
- 具体报错
- 原因
- 一般情况
- 其他情况
具体报错
Error: A JNI error has occurred, please check your installation and try again
原因
一般情况
报错如上一般情况是因为本地java
编译和java
运行版本不一致导致的。所以需要在Idea
中设置为一样的。设置如下图:【这里以jdk 1.8
为例】
01)点击FIle
--> Project Structure
02)设置Project
中SDK的版本一致
03)Modules
中 修改Sources
和 Dependencies
中版本一致
04)SDKs
设置版本一致
05)如有其他SDK
,设置Global Libraries
保持全局一致【并不是和JDK
一致,而是和该SDK
的其他版本一致】
06)点击Preferences
下的 该位置:设置版本一致
07)最后确认pom文件中是否有显式声明java编译版本等限制字符,如有,可以去掉。然后生效POM文件【有的可以自动生效,有的需要手动生效】
到这里基本一般情况就可以解决并运行了。
其他情况
有时候并不是版本不一致会导致该问题产生,有时候可能因为jar包或者类方法异常。如:
Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/spark/SparkContext
这个错误等也会导致A JNI error has occurred
01)确认该类【类所在jar】是否成功导入,如果没导入,pom中记得导入一下
02)导入有包,但是执行报错类异常,确认下是否pom文件中scope
属性是否设置了provided
,如果有去掉就可以了【本地可以去掉,打包的时候,如果环境中有该jar,那么打包的时候还需继续加上】
03)如果不喜欢来回改动pom文件,那么可以在如下位置,添加这个包,这样pom文件既可以保持原样,也可以在本地运行。
Idea报错: A JNI error has occurred相关推荐
- appium无法执行,报错 A JNI error has occurred或Could not find ‘apksigner.jar‘
An unknown server-side error occurred while processing the command. Original error: Cannot verify th ...
- eclipse报错:An error has occurred. See error log for more details. java.lang.NullPointerException
eclipse一直不停的报错: An error has occurred. See error log for more details. java.lang.NullPointerExceptio ...
- Eclipse启动报错:An error has occurred.See the log file
Eclipse打不开,报错:An error has occurred.See the log file. 解决方案如下: 1.打开cmd,输入java -version检查jdk是否安装好. 2.打 ...
- 创造虚拟环境报错An unexpected error has occurred. Conda has prepared the above report.解决方案
一.创造一个虚拟环境报错**:** An unexpected error has occurred. Conda has prepared the above report.Upload did n ...
- ENVI IDL报错:An error has occurred. See the log file快速解决方法
今天下午用ENVI的时候,突然出现了这个报错: 然后搜了一下"an error has occured. see the log file",出现了一些不太相关的解决方法,没什么用 ...
- JAVA--命令行窗口-java运行报错:Error: A JNI error has occurred,please check your installation and try again
现象: 进行Java程序的编译与运行. 在操作过程中报错,具体为javac编译成功,而java运行报错:如下图: 错误为:Error: A JNI error has occurred,please ...
- Java 报错Error:A JNI error has occurred, please check your installation and try again
jar运行时报错Error:A JNI error has occurred, please check your installation and try again. 目前我所遇到的有两种可能: ...
- 使用IntelliJ IDEA导入 Flink 消费kafka报错 Error: A JNI error has occurred, please check your installation an
提示找不到类,pom中已经引用了jar包,使用eclipse也可以执行,就是IntelliJ不行 java.lang.NoClassDefFoundError: org/apache/flink/ap ...
- lDEA报错Error: A JNI error has occurred, please check your installation and try again
今天java程序run出现 Error: A JNI error has occurred, please check your installation and try again 解决方法:修改j ...
- JAVA编译报错:A JNI error has occurred, please check your installation and try again
笔记:JDK版本不一致导致的错误::A JNI error has occurred, please check your installation and try again 今天通过Idea工具实 ...
最新文章
- SpringBoot如何处理java内存溢出
- 体质测试java代码_求java代码,要求做一个测试类,实现以下功能之一。最好三个功能都有。...
- Android界面开发问题总结
- 介绍50个 WordPress 动作挂钩
- NYOJ 562 盒子游戏
- 事件流调试器查看Retract事件
- DbNetSpell
- java微服务实战.pdf_Spring微服务实战 ([美]约翰·卡内尔) 中文完整pdf扫描版[172MB]...
- Android MediaCodec实现多段音视频的截取与拼接
- 【优化调度】基于matlab粒子群算法求解经济调度优化问题【含Matlab源码 1489期】
- 风力发电机液压偏航控制系统设计
- C#学习之IntPtr类型
- 文章2:多功能智能跟随行李箱控制系统设计 | 本科毕业设计 - 【论文终稿】
- 文件和异常——python从编程入门到实践
- RGB与CMYK以及加色与减色
- [Android Studio] 添加Override/Implement methods
- 微信可以登录,代理服务器没有响应
- 游戏私服频繁被DDOS攻击怎么办
- position: sticky 属性
- 生活随记 - 春节快递延误的正确处理方式