Closed yuujinleee closed 3 years ago
I will look at pom.xml for the maven to use java 11 compiler as a default for now.
pom.xml
and it works well (on my local only ❗ )Java version: 11.0.10
in my local when mvn -version
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<verbose>true</verbose>
<fork>true</fork>
<executable><!-- path-to-javac --></executable>
<compilerVersion>1.3</compilerVersion>
</configuration>
</plugin>
Ref. Apache Maven Compiler Plugin - Compiling Sources Using A Different JDK
pom.xml
(in my branch)<executable>"$JAVA_HOME"/bin/javac</executable>
mvn -version
yujinlee@Yujins-MacBook-Pro CSE364_Project % mvn -version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/Cellar/maven/3.6.3_1/libexec
Java version: 11.0.10, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-11.0.10.jdk/Contents/Home
Default locale: en_KR, platform encoding: UTF-8
OS name: "mac os x", version: "10.15.3", arch: "x86_64", family: "mac"
in order to maintain same java compiler version among us, I think you guys should also
Setting JAVA_HOME ENV variable on Mac
mvn -version
on local)mvn -version Apache Maven 3.6.3 Maven home: /usr/share/maven Java version: 11.0.10, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
I checked my java version. thank you!
Thanks @sanghun17 ! 😄
(최종)코멘트 포함 한 줄 요약 :
도커 컨테이너 내에서
mvn -version
실행 시는 자바 버전이11.0.10
으로 맞게 나오지만, 로컬에서 실행 시에는 자바 버전이15.0.2
로 나오는 경우가 있습니다. 그에 따라서pom.xml
에서이 와 같이 JAVA_HOME 경로를 직접 참조하는 코드를 추가하였으니 각자 로컬에서 JAVA_HOME 경로를 적절하게 JDK11의 경로에 맞춰주세요. (맥의 경우 Setting JAVA_HOME ENV variable on Mac 이 링크를 참조하면 쉽게 설정 가능합니다.)
-> 위에 코드 현재는 다시 제거 된 상태!
//-----요약 끝-----
1) When executed inside the docker container,
Java version: 11.0.10
2) However when compiled(mvn install) in my local,
Java version: 15.0.2
😨 ?????!I dont know why its happening.
I have also set the project dependency in InteliJ as JDK 11.0.10 as well