How to set default JDK Compliance level and release enabled in eclipse JDK preferences section

2.2k Views Asked by At

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.

1

There are 1 best solutions below

2
On

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.