Jump to content
Excelsior Forums
Sign in to follow this  
sc

Compiling Eclipse Plug-In AOT

Recommended Posts

We are looking for a way to compile a Eclipse plug-in AOT into native code, for anti-piracy reasons.

We are NOT looking to compile the entire Eclipse program using JET, but just a particular set of plug-ins we have written. The JET compiled Eclipse plug-ins must still be installable into a standard Eclipse installation (i.e. non-native compiled).

Is that possible at all?

Share this post


Link to post
Share on other sites

  >>We are NOT looking to compile the entire Eclipse

  >>program using JET, but just a particular set

  >>of plug-ins we have written. The JET compiled

  >>Eclipse plug-ins must still be installable into a

  >>standard Eclipse installation (i.e. non-native

  >> compiled).

You do not need to compile Eclipse as a whole. Excelsior JET Runtime is a complete Java Virtual Machine that works with both Java classes and the executable components produced by the JET AOT compiler so you may optimize/protect only a part of classes remaining the other part "as is".

 >>Is that possible at all?

If you want Eclipse to run using Sun JRE and to include your plug-in compiled with the JET AOT compiler, that is not possible, of course. It looks like running Eclipse under Sun JRE but executing a particular component using, for example, IBM JRE, at the same time.  

Share this post


Link to post
Share on other sites

You do not need to compile Eclipse as a whole. Excelsior JET Runtime is a complete Java Virtual Machine that works with both Java classes and the executable components produced by the JET AOT compiler so you may optimize/protect only a part of classes remaining the other part "as is".

In other words if we include our plug-ins with the Eclipse RCP platform, and then compile then whole lot with Excelsior JET it should work.

I read the Excelsior paper on compiling Eclipse. Reading between the lines, due to the use of class loader in Eclipse, it appears Excelsior JET cannot fully compile all the bytecode to native code. In other words the class files for the plug-ins might still be around. Is that true?

The goal of the exercise really is for anti-piracy. Although not desirable, we could live with compiling the entire Eclipse platform together with our proprietary plug-ins. What approach would you recommend?

Thanks,

Stephen

Share this post


Link to post
Share on other sites
I read the Excelsior paper on compiling Eclipse. Reading between the lines, due to the use of class loader in Eclipse, it appears Excelsior JET cannot fully compile all the bytecode to native code. In other words the class files for the plug-ins might still be around. Is that true?

You are right. Our current implementation does not enable protection of classes loaded by custom classloaders. In essence, the original class files are used only for consistency checks. The JET Runtime simply tests that the class being loaded is not changed since AOT compilation time.

We are now working on a technology of protecting dynamic components, such as Eclipse plugins, because there is high demand for the feature. It may appear in the next major release of Excelsior JET scheduled for 2Q 2006.

Share this post


Link to post
Share on other sites

Hello Excelsior,

"...It may appear in the next major release of Excelsior JET scheduled for 2Q 2006..."

This is the feature that I am waiting for before buying JET.  Can you give any idea when this may be available (given that we are well into 2Q '06  ;) )?

Regards,

Greg.

Share this post


Link to post
Share on other sites

Hello,

Unfortunately, this feature will not be implemented in the next release (JET 4.5) and we are not sure about its availability in the following JET version.

However, we are keeping in mind such special support for Eclipse plugins and we would like to find some resources to allocate for work on this feature during this year :).

By the way, you can check out Excelsior JET Roadmap to get some info on following JET releases:

http://www.excelsior-usa.com/jetroadmap.html

Regards,

Pavel

Share this post


Link to post
Share on other sites

Hi Pavel,

OK, a couple more questions as I don't fully understand the limitations

  • Is it correct that you can't use dynamic libraries (multi-components) with dynamic classloaders?
  • In your example of compiling eclipse, one of the steps is to start the application and use as much functionality of the application as possible.  This is probaly impractical for any sort of automated build system.  Is is sufficent for a class to be referenced in order to be compiled & cached?  Does it have to be referenced through every context that it would normally be loaded through?  i.e. Could I write one routine which references every class in the application or would I have to write such a routine in every context with a custom classloader?

Thanks for your help,

Greg.

Share this post


Link to post
Share on other sites

Is it correct that you can't use dynamic libraries (multi-components) with dynamic classloaders?

Not at all. Quite opposite: use of dynamic classloader force you to use JIT cache DLLs. However these JIT cache DLLs differ from ordinary DLLs: JIT cache DLLs require original classes to be loaded.

In your example of compiling eclipse, one of the steps is to start the application and use as much functionality of the application as possible.? This is probaly impractical for any sort of automated build system.? Is is sufficent for a class to be referenced in order to be compiled & cached?

All classes referenced from already loaded classes will be cached and compiled together with these loaded classes.

Does it have to be referenced through every context that it would normally be loaded through?? i.e. Could I write one routine which references every class in the application or would I have to write such a routine in every context with a custom classloader?

Such routine should be classloader-specific:

For any custom classloader used in the application, an individual routine should exist that loads only those classes which might be loaded by the classloader.

Regards,

Pavel

Share this post


Link to post
Share on other sites

Hi Pavel :)

Being able to properly compile Eclipse RCP based applications is a feature I would very much like to see in your product.  Any news on it being added soon?  The last date referenced in this thread said "Not Q2/06", how about 2007?  The roadmap document makes no mention of it that I can see.

Also, I wanted to clarify your answer in the previous message. 

If I write a method that for each plug-in included in my RCP app, references each class contained in that plug-in (in the context of that plug-in's classloader) then will I be able completely compile my app ahead-of-time, or is that just a shortcut to avoid  having to do the manual cache warming steps in KB000010? (i.e. I would still need to compile the cache created by the JIT compiler after my method ran)

Cheers,

Josh

Share this post


Link to post
Share on other sites

Hello,

Any news on it being added soon?? The last date referenced in this thread said "Not Q2/06", how about 2007?

We definitely plan to feature such a technology in this year (3-4Q 2007).

The roadmap document makes no mention of it that I can see.

Thank you for pointing it. The Roadmap page is really outdated and shall be fixed soon.

If I write a method that for each plug-in included in my RCP app, references each class contained in that plug-in (in the context of that plug-in's classloader) then will I be able completely compile my app ahead-of-time, or is that just a shortcut to avoid? having to do the manual cache warming steps in KB000010? (i.e. I would still need to compile the cache created by the JIT compiler after my method ran)

You are right. Note, however, that you would need to reference each class explicitly, for instance


import mypackage.*; // Foo, Bar, etc.

class Hello {
? ? ?...
? ? ?void ref() {
? ? ? ? ?Class clazz = Foo.class;
? ? ? ? ?clazz = Bar.class;
? ? ? ? ?// etc
? ? ?}
}

Share this post


Link to post
Share on other sites

Hi!

Is there any update on the status of this?  We are now just starting into Q3'07 and this feature is required for us to use your product.  Just curious if you are still on track for your Q3/Q4 goal.

Thanks

Shaun

Share this post


Link to post
Share on other sites

Unfortunately, at the moment, we still do not have enough engineering resources to implement this feature. However, the root problem shall be solved in forthcoming Java 7, which will be certainly supported in Excelsior JET.

There is a draft of JSR277 (Java Specification Requests) that addresses the problems with classloaders. You may check it at

http://jcp.org/en/jsr/detail?id=277

Share this post


Link to post
Share on other sites

Your voices have been counted, thanks for your feedback!

I'm glad to inform you that today Excelsior has published the first beta of Excelsior JET 6.5 that meets your requirements. You may find more about the new offering and download the beta version at

http://www.excelsior-usa.com/protect-eclipse-rcp-applications.html

--ZZ Top

P.S. I'm writing this post after watching the total solar eclipse that happened in our city two hours ago. ;)

http://eclipse.gsfc.nasa.gov/SEmono/TSE2008/TSE2008.html

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×