Bug 431923 - Support for Java SE Embedded Profiles
Summary: Support for Java SE Embedded Profiles
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.3.2   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-03 10:32 EDT by BJ Hargrave CLA
Modified: 2016-04-21 02:00 EDT (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description BJ Hargrave CLA 2014-04-03 10:32:07 EDT
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.
Comment 1 Stephan Herrmann CLA 2014-04-03 10:48:58 EDT
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)?
Comment 2 Olivier Thomann CLA 2014-04-03 11:03:03 EDT
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.
Comment 3 BJ Hargrave CLA 2014-04-03 11:09:16 EDT
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.
Comment 4 Christian Gossart CLA 2014-07-03 10:14:22 EDT
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.
Comment 5 Srikanth Sankaran CLA 2014-09-10 23:44:14 EDT
Olivier, should this first be looked at by some component other than JDT/Core ?
Comment 6 Stephan Herrmann CLA 2015-08-28 06:11:33 EDT
Let's investigate this.
Comment 7 Jay Arthanareeswaran CLA 2015-08-28 08:05:45 EDT
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.
Comment 8 Manoj N Palat CLA 2016-04-21 02:00:48 EDT
Moving out of 4.6 - retarget to 4.7 if somebody takes this up