今天在看《深入理解 Java 虚拟机 (JVM 高级特性与最佳实践)》关于垃圾回收的一些知识。自己建立了一个java工程,敲了一下书上写的代码。运行java程序的时候报错:
java.lang.SecurityException: Prohibited package name: java.gc.aty
我的代码如下:
package java.gc.aty; public class DeepUnderJvm { private static final int _1MB = 1024 * 1024; public static void main(String[] args) { byte[] allocation1 = null; byte[] allocation2 = null; byte[] allocation3 = null; byte[] allocation4 = null; allocation1 = new byte[2 * _1MB]; allocation2 = new byte[2 * _1MB]; allocation3 = new byte[2 * _1MB]; allocation4 = new byte[4 * _1MB]; } }
java.lang.SecurityException: Prohibited package name,布布扣,bubuko.com
java.lang.SecurityException: Prohibited package name
原文地址:http://blog.csdn.net/aitangyong/article/details/25338991