Problem description
When running code. The following error is reported:
"D:\Program Files\Java\jdk1.8.0_301\bin\java.exe" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:54797,suspend=y,server=n -javaagent:C:\Users\Administrator\AppData\Local\JetBrains\IntelliJIdea2020.3\captureAgent\debugger-agent.jar -Dfile.encoding=UTF-8 -classpath "D:\program files\Java\jdk1.8.0_301\jre\lib\charsets.jar;D:\program files\Java\jdk1.8.0_301\jre\lib\deploy.jar;D:\program files\Java\jdk1.8.0_301\jre\lib\ext\access-bridge-64.jar;D:\program files\Java\jdk1.8.0_301\jre\lib\ext\cldrdata.jar;D:\program files\Java\jdk1.8.0_301\jre\lib\ext\dnsns.jar;D:\program files\Java\jdk1.8.0_301\jre\lib\ext\jaccess.jar;D:\program files\Java\jdk1.8.0_301\jre\lib\ext\jfxrt.jar;D:\program files\Java\jdk1.8.0_301\jre\lib\ext\localedata.jar;D:\program files\Java\jdk1.8.0_301\jre\lib\ext\nashorn.jar;D:\program files\Java\jdk1.8.0_301\jre\lib\ext\sunec.jar;D:\program files\Java\jdk1.8.0_301\jre\lib\ext\sunjce_provider.jar;D:\program files\Java\jdk1.8.0_301\jre\lib\ext\sunmscapi.jar;D:\program files\Java\jdk1.8.0_301\jre\lib\ext\sunpkcs11.jar;D:\program files\Java\jdk1.8.0_301\jre\lib\ext\zipfs.jar;D:\program files\Java\jdk1.8.0_301\jre\lib\javaws.jar;D:\program files\Java\jdk1.8.0_301\jre\lib\jce.jar;D:\program files\Java\jdk1.8.0_301\jre\lib\jfr.jar;D:\program files\Java\jdk1.8.0_301\jre\lib\jfxswt.jar;D:\program files\Java\jdk1.8.0_301\jre\lib\jsse.jar;D:\program files\Java\jdk1.8.0_301\jre\lib\management-agent.jar;D:\program files\Java\jdk1.8.0_301\jre\lib\plugin.jar;D:\program files\Java\jdk1.8.0_301\jre\lib\resources.jar;D:\program files\Java\jdk1.8.0_301\jre\lib\rt.jar;E:\JetBrains\spring学习\spring-study\spring-study-01-ioc1\target\test-classes;E:\JetBrains\spring学习\spring-study\spring-study-01-ioc1\target\classes;D:\java\maven-3.8.1-bin\apache-maven-3.8.1\maven_repository\org\springframework\spring-webmvc\5.3.10\spring-webmvc-5.3.10.jar;D:\java\maven-3.8.1-bin\apache-maven-3.8.1\maven_repository\org\springframework\spring-aop\5.3.10\spring-aop-5.3.10.jar;D:\java\maven-3.8.1-bin\apache-maven-3.8.1\maven_repository\org\springframework\spring-beans\5.3.10\spring-beans-5.3.10.jar;D:\java\maven-3.8.1-bin\apache-maven-3.8.1\maven_repository\org\springframework\spring-context\5.3.10\spring-context-5.3.10.jar;D:\java\maven-3.8.1-bin\apache-maven-3.8.1\maven_repository\org\springframework\spring-core\5.3.10\spring-core-5.3.10.jar;D:\java\maven-3.8.1-bin\apache-maven-3.8.1\maven_repository\org\springframework\spring-jcl\5.3.10\spring-jcl-5.3.10.jar;D:\java\maven-3.8.1-bin\apache-maven-3.8.1\maven_repository\org\springframework\spring-expression\5.3.10\spring-expression-5.3.10.jar;D:\java\maven-3.8.1-bin\apache-maven-3.8.1\maven_repository\org\springframework\spring-web\5.3.10\spring-web-5.3.10.jar;D:\java\maven-3.8.1-bin\apache-maven-3.8.1\maven_repository\junit\junit\4.13\junit-4.13.jar;D:\java\maven-3.8.1-bin\apache-maven-3.8.1\maven_repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;D:\program files\JetBrains\IntelliJ IDEA 2020.3.4\lib\idea_rt.jar" java.MyTest01
Connected to the target VM, address: '127.0.0.1:54797', transport: 'socket'
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.SecurityException: Prohibited package name: java
at java.lang.ClassLoader.preDefineClass(ClassLoader.java:655)
at java.lang.ClassLoader.defineClass(ClassLoader.java:754)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:601)
Disconnected from the target VM, address: '127.0.0.1:54797', transport: 'socket'
Process finished with exit code 1
Cause analysis:
Through the analysis of the error, I learned that I wrote that the use of java package’s name is prohibited in Java
Solution:
Delete and modify the name of java package to other
Read More:
- [Solved] ZK Connect Error: A JNI error has occurred, please check your installation and try again
- [Solved] Error: A JNI error has occurred, please check your installation and try again
- [Solved] Eclipse Error: A JNI error has occurred, please check your installation and try again
- [Solved] JAVA Error: Error:A JNI error has occurred,please check your installation and try again
- OTA Pack Compile Error: ExternalError: Failed to run signapk.jar: return code 1:Error: A JNI error has occurred
- Jmeter Error: ERROR o.a.j.JMeter: Uncaught exception in thread Thread[AWT-EventQueue-0,6,main]
- [Solved] Docker Elasticsearch8.4.0 Error: Exception in thread “main” java.nio.file.FileSystemException
- Eclipse Error: Could not create the Java Virtual Machine Error:A fatal exception has occurred
- Mybatis query error: Exception in thread “main” org.apache.ibatis.exceptions.PersistenceException…
- [Solved] Exception in thread “main“ java.lang.NoSuchFieldError: level
- [Solved] Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred.
- [Solved] qrcode-error: Exception in thread “main” java.lang.NoClassDefFoundError…
- [Solved] javajdk1.8 Run javaFx Error: Error:Error: A fatal exception has occurred. Unrecognized option: –module-path
- Java uses class array to report error Exception in thread “main” java.lang.NullPointerException solution
- [Solved] Hadoop Error: Exception in thread “main“ java.io.IOException: Error opening job jar: /usr/local/hadoop-2.
- JNI ERROR (2354): JNI connection is NULL [How to Solve]
- [Solved] Linux java -jar Start Project Error: Unsupported major.minor version 52.0
- How to Solve JAVA Error: error: A JNI error has occureed
- The thread implementation of timer in Java
- Java uses single thread pool to realize multi thread sequential execution (non alternating, non synchronous)