运行java程序总弹出 A Java Exception has occurred 然后下方窗口有很多红色的代码
Exception in thread "main" java.lang.SecurityException: Prohibited package name: java.test.string
at java.lang.ClassLoader.preDefineClass(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
解决办法:
包名中不能带有java,把包名java.test.string改成其他的,如cn.test.string即可。
分享到:
相关推荐
Eclipse运行TOMCAT 出现在a java exception has occurred的解决办法。
反编译工具两个版本,一个支持jdk1.7的 如果打开弹出这个提示 A Java Exception has occurred 可以使用另外一个1.7版本的试试看
exception基础,异常的基本用法。
JD-GUI是使用C++开发的一款Java反编译工具,它是一个独立图形界面的Java源代码“.class”文件反编译工具。 JD-GUI是使用C++开发的一款Java反编译工具,它是一个独立图形界面的Java源代码“.class”文件反编译工具。
最新版jd-gui,适用于x86版本的JDK,JDK最低要求1.6,最高支持1.8
java反编译工具1.4.1!
远程调试(debug运行中tomcat的服务器代码)
Java代码 代码如下: <...“An exception has occurred.Error was:\n\n”+error.message); } } [removed] </head> <body> <input type=”button” value=”Test” onclick=”test(nul
* This method is called when a form has its tag value method equals to get. * * @param request the request send by the client to the server * @param response the response send by the server to...
Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.NoClassDefFoundError: com/mashape/unirest/http/exceptions/UnirestException at java....