Community
Participate
Working Groups
In JDK 8, javac supports the -profile option to allow you to verify the code being compiled does not use Java SE API outside of the specified Java SE profile. http://www.oracle.com/technetwork/java/embedded/resources/tech/compact-profiles-overview-2157132.html This is an important feature that JDT needs to support. OSGi will need this feature when moving up to Java 8 to ensure our API will run on Java SE Embedded runtimes.
Am I right that this feature is not covered by any JSR and the page you link is the actual definition? Are you requesting this for the batch compiler or for IDE use (or both)?
In order to get this support, all compact profiles would need to be specified in a way that let the JDT team consume it. Depending on the way this is specified, we could leverage the support for api tools api definitions to support this.
The profiles are not defined by a JSR but by a JEP: http://openjdk.java.net/jeps/161 My interest is IDE use. At OSGi, we use Eclipse for the IDE and offline build with JDK. But I imagine others may care for batch compiler use. I imagine many people use the Eclipse IDE for embedded Java development. Support for these profiles will be necessary as Java ME CDC/Foundation is now replaced by Java SE Embedded.
I'm in a process of setting up a development environment targeting Java SE Embedded compact3 using the last release of Luna (4.4.0), and I'm really interested in this feature. To ensure that the code cannot use any Java SE API outside compact3, I ended up creating an embedded compact3 JRE with the Oracle jrecreate tool and using it as "Installed JRE". As a matter of fact, I needed some supplementary classes outside compact3 (java.beans package), but didn't want to use the Full Embedded JRE. Adding those classes in the endorsed directory of the compact3 JRE did the trick. I don't know the internals of JDT, and how such a support for embedded profiles will be implemented, but I think it should add to the packages defined in JEP161 those given dynamically through the Java Endorsed Standards Mechanism, as it is a legit way to override/augment the JRE.
Olivier, should this first be looked at by some component other than JDT/Core ?
Let's investigate this.
Sorry for not having looked at this earlier. I fight this interesting especially in light of the imminent Java 9 and the modular JDK proposal. This is one of the goals from JEP 200: "Configurations roughly equivalent in content to each of the Compact Profiles defined in Java SE 8; " I have no idea what the 'configuration' will look like, though.
Moving out of 4.6 - retarget to 4.7 if somebody takes this up