• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Creating new maven project in Eclipse defaults to 1.5 NOT 1.8 or 12

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to build a maven project in Eclipse using the "create a simple project / skip archetype". I have JDK 1.8xx, JDK 11 and jdk 12. In eclipse I have it pointed to jdk 12 for my installed jre.

java_home is set to: java 12
Maven is 3.6

Right now when I create a empty simple maven project it defaults to java 1.5. I know I can change that in the pom, but I want to have it default to at least java 8 when It is created, so I don't have to do that.
How do I do that? I've not really found an answer any place. It it even possible?
 
Saloon Keeper
Posts: 2619
329
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried specifying the compiler version properties?
 
Karina Guenther
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know I can do that. HOWEVER, I don't want to have to do that. Plus, I still have to change the jre in the build properties. I want it to automatically use the java that I have specified in Eclipse when I create the project. Or even in some settings file somewhere.


Ron McLeod wrote:Have you tried specifying the compiler version properties?

 
Ron McLeod
Saloon Keeper
Posts: 2619
329
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the maven plugin for current release of Eclipse is using version 3.1 of maven-compiler-plugin, and it has a default value of 1.5.  Even if you went to the latest, version 3.81, it has a default of 1.6.

Maybe someone else can suggest a plugin which can sync to the Eclipse's project configuration.
 
Master Rancher
Posts: 451
6
IntelliJ IDE Spring Fedora
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think probably just changing the compiler version manually seems way easier than messing around with the plugins considering you will only do it once per project.  Unless you are making tons of new projects that is.
 
author & internet detective
Posts: 39343
755
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This Stack Overflow post suggests messing with the Eclipse plugin config. I wouldn't do that though. I'd just change the pom when I create a project. or inherit from a team parent pom that already has the defaults i want.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!