Maven error :Perhaps you are running on a JRE rather than a JDK?

后端 未结 20 2315
小鲜肉
小鲜肉 2020-11-30 21:32

I\'ve never worked with Maven before and I am following the instructions here. When I run the command

mvn integration-test -Pamp-to-war

It

20条回答
  •  無奈伤痛
    2020-11-30 21:54

    Here's my automatic solution...

    This will follow your javac executable's symlink (setup by yum and/or alternatives --config java) backwards to find the JAVA_HOME. (Toss this in your in your /etc/profile):

    export JAVA_HOME=$(readlink -f /usr/bin/javac | sed 's:/bin/javac$::')
    

    If you wanted a stable path (refreshed on boot) launch something like this:

    export JAVA_HOME=$(readlink -f /usr/bin/javac | sed 's:/bin/javac$::')
    ln -sfn "${JAVA_HOME}" /usr/lib/jvm/jdk-current
    

    I'm kinda shocked the latter still isn't baked into alternatives.

提交回复
热议问题