r/javahelp • u/ToBeAButterFly • Jun 02 '20
Setting Maven-compiler-version to Amazon Corretto?
I hope this question is still appropriate for this forum. Not really sure where I can ask for help regarding this.
I'm trying to learn Spring and SpringBoot . I have a mentor who has me learning by working on a small project and one task I was given has confused me but I won't meet with him until Friday. I can email but I just want to run this by someone before I bring it up to him because I think I may have missed something.
I need to change the application's Java version from 1.8 to Amazon Corretto 8.
Maven currently has the maven-compiler-plugin configuration set with source = 1.8 and target = 1.8.
When I was Googling for information about this it looks like this is just set in the project's IDE or I guess the machine it's being built on? So it's not a POM change ?
https://unix.stackexchange.com/questions/548172/maven-compiler-version-for-amazon-corretto
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>2
u/guss_bro Jun 03 '20
Correto, openjdk, Oracle, Azul jdk etc are just jdk implementation. You need to put one of them on JAVA_HOME path.
1.8 is version. Maven doesn't care which implementation of jdk that you sent on your environment/java_home.
1
0
u/nutrecht Lead Software Engineer / EU / 20+ YXP Jun 02 '20
I need to change the application's Java version from 1.8 to Amazon Corretto 8.
That makes no sense at all. Coretto is just a JDK distribution. In no way is a Java applition tied to or even aware of the JDK used to build or run it.
What those config properties do is decide what language level to use. If you want to use a specific JDK to compile, set your PATH and JAVA_HOME accordingly.
So it's not a POM change ?
No, and you really should explain what you're trying to do because it makes no sense.
7
u/TheSecondist Jun 02 '20
Chill man, the guy/gal is a beginner. If OPs knowledge of the Java/programming is limited and they don't fully understand the problem, which is perfectly normal for a beginner, how could they ask a perfect question? Also in this case, I would say, that the question is in fact rather clear
2
u/nutrecht Lead Software Engineer / EU / 20+ YXP Jun 02 '20
I'm not asking them to write a perfect answer. I'm trying to figure out what they're trying to do exactly. He was giving this task by his 'mentor' and I'm telling him that the request his mentor gives makes no sense to me.
1
u/TheSecondist Jun 02 '20
I agree on that one, elaboration on the mentors exact instructions would be needed, to figure out what the mentor actually wanted OP to accomplish
7
u/TheSecondist Jun 02 '20
Corretto is just a java implementation. So if you tell Maven that you have 1.8 source code and want to target a 1.8 Java VM, then Maven won't care if that is corretto or maybe Oracle Java, as long as you provide a version 8 of them.
If Corretto or something else is used will then be decided by either your IDE settings or your JAVA_HOME variable (could also be the first javac that is on your PATH variable, not sure, maybe someone else can pitch in)