Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change the default Eclipse Oxygen compiler compliance level from 9 to 1.8 and not have it revert back to 9?

When I open a workspace in Eclipse Oxygen, the default compiler compliance level is set to 9. I change it in Preferences > Java > Compiler back to 1.8 and click Apply. It works, until I close Eclipse and reopen it and now it's back to 9. How can I make the change stick?

Note: I know that /instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.compliance is set somewhere to 9, but I can't find out where that is.

like image 322
Shant Dashjian Avatar asked Oct 15 '25 14:10

Shant Dashjian


1 Answers

My workspace settings were getting over-written by user-specific settings stored in ~/.eclipse/org.eclipse.oomph.setup/setups/user.setup. Specifically, that file included those leftover setup lines from a previous installation:

<setupTask
      xsi:type="setup:PreferenceTask"
      key="/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.codegen.targetPlatform"
      value="9"/>
  <setupTask
      xsi:type="setup:PreferenceTask"
      key="/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.compliance"
      value="9"/>
  <setupTask
      xsi:type="setup:PreferenceTask"
      key="/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.source"
      value="9"/>
</setupTask>

Solution: Remove the lines above from ~/.eclipse/org.eclipse.oomph.setup/setups/user.setup.

Note: Thanks to @skomisa who helped me figure this out.

like image 66
Shant Dashjian Avatar answered Oct 18 '25 17:10

Shant Dashjian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!