Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » How to set default compiler compliance level inside plugin
How to set default compiler compliance level inside plugin [message #666385] Wed, 20 April 2011 09:29 Go to next message
Sergei  is currently offline Sergei Friend
Messages: 2
Registered: April 2011
Junior Member
I develop eclipse plugin and I need to set default compiler compliance level to 1.5 inside plugin.

As I know there is a org.eclipse.jdt.core.prefs file with such preference.

How can I change this preference using API level?

[Updated on: Wed, 20 April 2011 11:58]

Report message to a moderator

Re: How to set default compiler compliance level inside plugin [message #666414 is a reply to message #666385] Wed, 20 April 2011 11:18 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 04/20/2011 05:29 AM, Sergei wrote:
> I develop eclipse plugin and I need to set default compiler compliance
> level to 1.5 inside plugin.

Is it that you want to do it programmatically? Normally in PDE you set
it in the MANIFEST.MF:
Bundle-RequiredExecutionEnvironment: J2SE-1.5

And then if necessary right click on the project and use PDE
Tools>Update Classpath

Later,
PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: How to set default compiler compliance level inside plugin [message #666417 is a reply to message #666414] Wed, 20 April 2011 12:01 Go to previous message
Sergei  is currently offline Sergei Friend
Messages: 2
Registered: April 2011
Junior Member
Thank you!

I've found solution:

Hashtable options = JavaCore.getDefaultOptions();
JavaCore.setComplianceOptions(JavaCore.VERSION_1_5, options);
JavaCore.setOptions(options);

[Updated on: Wed, 20 April 2011 12:01]

Report message to a moderator

Previous Topic:Including jar from Plugin
Next Topic:create contextual menu in eclipse
Goto Forum:
  


Current Time: Sat Aug 08 15:51:58 GMT 2020

Powered by FUDForum. Page generated in 0.01476 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top