You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Scott Carey (JIRA)" <ji...@codehaus.org> on 2015/01/18 00:47:18 UTC

[jira] (MNG-5686) mvn cannot execute /usr/libexec/java_home/bin/java on OS X.

    [ https://jira.codehaus.org/browse/MNG-5686?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=361310#comment-361310 ] 

Scott Carey commented on MNG-5686:
----------------------------------

This issue is marked as Closed, fixed for 3.2.5, but mvn 3.2.5 still has this issue for me.

> mvn cannot execute /usr/libexec/java_home/bin/java on OS X.
> -----------------------------------------------------------
>
>                 Key: MNG-5686
>                 URL: https://jira.codehaus.org/browse/MNG-5686
>             Project: Maven
>          Issue Type: Bug
>          Components: Command Line
>    Affects Versions: 3.2.3
>         Environment: Mac OS X 10.9.4
>            Reporter: Takayoshi Fujiki
>            Assignee: Kristian Rosenvold
>             Fix For: 3.2.5
>
>         Attachments: 0001-Fix-whitespace-bashisms-in-mvn-shell-scripts.patch, 0001-Fix-whitespace-bashisms-in-mvn-shell-scripts.v2.patch, 0002-MNG-5686-detect-JAVA_HOME-on-newer-OSX-again.patch, maven-bin-mvn.patch
>
>
> From 3.2.3, mvn cannot start and outputs the following error.
> {code}
> $ ./apache-maven-3.2.3/bin/mvn -version
> Error: JAVA_HOME is not defined correctly.
>   We cannot execute /usr/libexec/java_home/bin/java
> {code}
> 3.2.2 doesn't have this problem.
> {code}
> $ ./apache-maven-3.2.2/bin/mvn -version
> Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T22:51:42+09:00)
> Maven home: /Users/xxx/tmp/apache-maven-3.2.2
> Java version: 1.8.0_11, vendor: Oracle Corporation
> Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "mac os x", version: "10.9.4", arch: "x86_64", family: "mac"
> {code}
> When I modified {{bin/mvn}} like the following, this problem was gone.
> {code}
> --- bin/mvn.orig	2014-09-10 03:33:52.000000000 +0900
> +++ bin/mvn	2014-09-10 03:34:18.000000000 +0900
> @@ -83,7 +83,7 @@
>               #
>               # Apple JDKs
>               #
> -             export JAVA_HOME=/usr/libexec/java_home
> +             export JAVA_HOME="`/usr/libexec/java_home`"
>             fi
>             ;;
>  esac
> {code}
> Maybe MNG-5658 is related to this problem. {{/usr/libexec/java_home}} is a command([java_home(1)|https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man1/java_home.1.html]), and {{$(command)}} is a style of [Command Substitution|http://www.tldp.org/LDP/abs/html/commandsub.html] (Another(old) style is {{`command`}}).
> So removing "$()" breaks the JAVA_HOME detection on OS X.



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)