1. 程式人生 > >java.lang.SecurityException: Prohibited package name:java.xxx.xxx.xxx

java.lang.SecurityException: Prohibited package name:java.xxx.xxx.xxx

java.lang.SecurityException: Prohibited package name: java.xxx.yyy.zzz

java.patterns.v1.Test
java.lang.SecurityException: Prohibited package name: java.patterns.v1
    at java.lang.ClassLoader.preDefineClass(ClassLoader.java:658)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:794)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader$1.
run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.
lang.ClassLoader.loadClass(ClassLoader.java:358) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482) Exception in thread "main" Process finished with exit code 1

原因:java虛擬機器不允許包名以java開頭

package java.peace.demo;		//錯誤寫法

public class Test {
	...
}