Is this "javax" illegal (reserved) package name or not?

I found information that java. * and javax. * are illegal (reserved) package names (in the book "OCA Java SE 7 Programmer and Study Guide"). When I try to create the java package and run the class from it, I get:

Exception in thread "main" java.lang.SecurityException: Prohibited package name: java 

but when I run the class from the javax package, I get no errors. On docs.oracle.com, I found only information:

 Packages in the Java language itself begin with java. or javax. 

so ... is "javax" an illegal name or not? Maybe it is illegal only on Java EE or older versions of Java? (I tried this on JDK 1.6.0_43 and 1.7.0_25)

+7
java packages naming
source share
1 answer

javax. used for extensions (possibly in the JRE), so you can define classes in these packages. IIRC, this can be disabled in untrusted contexts by adding javax. to the package.definition security property (unchecked).

java. is special because ClassLoader prevents the non-bootstrap class from loading in these packages as a measure of protection from Microsoft.

+3
source share

All Articles