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)
java packages naming
Sathoh
source share