Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Automatically change the compiler level
Automatically change the compiler level [message #1865946] Wed, 15 May 2024 16:07 Go to next message
Eclipse UserFriend
Hello, we use Eclipse IDE (4.13) and Git as version control system. Due to a Java update from 1.8 to 17, the different software versions (Git branches) must be compiled with the corresponding compiler level (1.8 or 17) in Eclipse. This is necessary because the class files for our patch process still have to be created manually. This means that if you switch between the Git branches, the compiler level (the correct one) must be set manually in Eclipse. Is there a way to automate this in Eclipse?
Something like this: If you switch to branch x, the correct compiler level is set automatically.

Thanks in advance!
Re: Automatically change the compiler level [message #1865964 is a reply to message #1865946] Thu, 16 May 2024 09:14 Go to previous messageGo to next message
Eclipse UserFriend
Such settings can be stored per-project and checked into Git, e.g.,

https://github.com/eclipse-emf/org.eclipse.emf/blob/master/plugins/org.eclipse.emf.common/.settings/org.eclipse.jdt.core.prefs
https://github.com/eclipse-emf/org.eclipse.emf/blob/master/plugins/org.eclipse.emf.common/.classpath
Re: Automatically change the compiler level [message #1865967 is a reply to message #1865946] Thu, 16 May 2024 10:12 Go to previous messageGo to next message
Eclipse UserFriend
The preference page where you set this for the workspace has a corresponding page
in the project's Properties dialog. You can set the compiler level into the project itself,
where it will be stored in the project's .settings folder. Commit that into your branches
and it should behave as you've asked.

[Updated on: Thu, 16 May 2024 10:19] by Moderator

Re: Automatically change the compiler level [message #1865976 is a reply to message #1865946] Thu, 16 May 2024 16:26 Go to previous message
Eclipse UserFriend
Thank you. I will try out your approaches
Previous Topic:navigate -> go to -> package is disabled
Next Topic:remember and restore tree portion of the IDE when re-opening
Goto Forum:
  


Current Time: Thu Jul 03 05:05:19 EDT 2025

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

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

Back to the top