IDE Backend Maven package error "Cannot run program "javac": error=2
Problem↓↓↓

Env Info ↓↓↓
- JetBrains Gateway 2021.3.2
Build #GW-213.6777.25, built on January 20, 2022
Runtime version: 11.0.13+7-b1751.25 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 11.4
GC: G1 Young Generation, G1 Old Generation
Memory: 512M
Cores: 12 - Maven
①Boundled (Maven 3)
②apache-maven-3.8.1 (from maven.apache.com) - Java
①graalvm-ce-java8-21.1.0 (from www.graalvm.org)
②temurin-1.8 Eclipse Temurin version 1.8.0_322 (from IDEA Download JDK) - Scala
①scala-sdk-2.13.6 in Global Library (from www.scala-lang.org)
I think the problem relate to $JAVA_HOME. Strangely, it is normal in Terminal, which makes me think there is something wrong with IDE Backend. What can I do ? I don't want to copy long strings of mvn command to package every time.
It is worth mentioning that $JAVA_HOME was missing from ~/.zshrc when I first installed the IDE Backend by Jetbrains Gateway. After that, I tried JDK Maven from different sources installed by the IDE itself, and I removed the project and uninstalled Gateway and started all over again. This problem I've never encountered in my local development (MBP 2016)
My JAVA_HOME settings is
/root/.java_env
echo '[ ! -f /root/.java_env ] || . /root/.java_env' >> ~/.bashrc ~/.zshrc /etc/profile
Thank the people who are willing to help me anyway
Please sign in to leave a comment.