0

I want to perform a PDE build for my RCP product. I am compiling my product with JDK 11 but I want to set --release option as 1.8. I wanted to know how we can provide a default compliance setting in eclipse. So I can build my product with eclipse settings.

enter image description here

I want to set --release option as 8. But we can't add release option to <java /> tag. So I need to set a compliance level as 1.8 (by default) in JDT preferences.

Can anyone answer how we can set default compliance level and enable --release option in eclipse?

The eclipse version is 4.12 and I want to set release option as 8 for PDE build.

What all the options I have tried

  1. Set compliance level to 1.8 but it is setting for particular workspace. It is not setting for default.
  2. I have copied org.eclipse.jdt.core.prefs from workspace to \eclipse\configuration.settings
  3. Provided javacSource & javacTarget (But here we need to provide --release value)

Thanks in advance.

pvyas
  • 41
  • 5
  • In the project (_Project > Properties: Java Compiler_) set the _Compiler compliance level_ to 8. By the way, your Eclipse is pretty old. You are 4 releases behind. Please upgrade. – howlger Jun 29 '20 at 12:09
  • I know how to set compliance level. But the thing is I need to set it for all workspace. – pvyas Jun 29 '20 at 13:55
  • That doesn't make any sense to me. Please describe the problem with a reproducible example, including what you are actually getting and what you expect to get. Note that PDE build is deprecated and Tycho is now the standard for building RCP applications. – howlger Jun 29 '20 at 14:10
  • If we set compliance level 1.8 and then if we reopen eclipse with different workspace, it will change the compliance level to 11 (11 is installed). I want it same for all workspace. – pvyas Jun 30 '20 at 04:46
  • To share preferences accross workspaces, use the _Preference Recorder_ which can be enabled in _Window > Preferences: Oomph > Setup Tasks > Preference Recorder_. – howlger Jun 30 '20 at 07:16
  • I am not able to find _Window > Preferences: Oomph > Setup Tasks > Preference Recorder_ (I have installed the Oomph) – pvyas Jun 30 '20 at 08:31
  • Oomph is a project that provides different things, e.g. the _Eclipse Installer_, the _Preference Recorder_ and other things. You've updated your Eclipse in the meantime, right? Which IDE package do you have? – howlger Jun 30 '20 at 09:29

1 Answers1

0

Eclipse works on workspace level. So all the configuration are stored in workspace. Project > Properties: Java Compiler will set the java compiler version to one particular version for a workspace. You may not be able to set it for all workspace in one shot in Eclipse.

I would suggest the following

  1. set JDK_HOME environment variable to required version of Java
  2. Place required Java version path to PATH variable in the begining.

then start eclipse and check.

babyinEclipse
  • 505
  • 11
  • 21
  • you are right, all the configuration is stored in the workspace. I tried your suggestion but didn't work. It is still showing the 11 instead of 1.8 (JDK_HOME). – pvyas Jun 30 '20 at 07:04
  • can you check eclipse.ini file? and also in command prompt what is the java version you are getting? – babyinEclipse Jun 30 '20 at 11:40