Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Issues with Boxen Java and maven #51

Open
petems opened this issue Dec 30, 2014 · 2 comments
Open

Issues with Boxen Java and maven #51

petems opened this issue Dec 30, 2014 · 2 comments

Comments

@petems
Copy link
Member

petems commented Dec 30, 2014

So, I've been having a long standing issue with boxen and maven.

For example, I clone: https://github.com/scobal/seyren

I run mvn clean verify

I get:

exceptionGettingDataFromGraphiteIsHandled(com.seyren.core.util.graphite.GraphiteHttpClientTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.UnsupportedClassVersionError: org/eclipse/jetty/server/Handler : Unsupported major.minor version 51.0

All the things I'm reading are basically saying "You're pointing at the wrong version of java"

And someone then said "Check your maven bin script, it's probably setting $JAVA_HOME incorrectly"

So I look and I see this:

# OS specific support.  $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
  CYGWIN*) cygwin=true ;;
  MINGW*) mingw=true;;
  Darwin*) darwin=true            
           #
           # Look for the Apple JDKs first to preserve the existing behaviour, and then look
           # for the new JDKs provided by Oracle.
           # 
           if [[ -z "$JAVA_HOME" && -L /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK ]] ; then
             #
             # Apple JDKs
             #
             export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
           fi

           if [[ -z "$JAVA_HOME" && -L /System/Library/Java/JavaVirtualMachines/CurrentJDK ]] ; then
             #
             # Apple JDKs
             #
             export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home
           fi

           if [[ -z "$JAVA_HOME" && -L "/Library/Java/JavaVirtualMachines/CurrentJDK" ]] ; then
             #
             # Oracle JDKs
             #
             export JAVA_HOME=/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home
           fi           

           if [[ -z "$JAVA_HOME" && -x "/usr/libexec/java_home" ]] ; then
             #
             # Apple JDKs
             #
             export JAVA_HOME=/usr/libexec/java_home
           fi
           ;;
esac

Is there a way to fix how we set the java home so maven can work?

@ghost
Copy link

ghost commented Dec 30, 2014

A well installed jdk framework under OSX seems to be linked via /Library/Java/JavaVirtualMachines/Home?

Where does CurrentJDK come from?

-- 
Julien Lavergne
Sent with Airmail

On December 30, 2014 at 2:13:37 PM, Peter Souter ([email protected]) wrote:

So, I've been having a long standing issue with boxen and maven.

For example, I clone: https://github.com/scobal/seyren

I run mvn clean verify

I get:

exceptionGettingDataFromGraphiteIsHandled(com.seyren.core.util.graphite.GraphiteHttpClientTest) Time elapsed: 0 sec <<< ERROR!
java.lang.UnsupportedClassVersionError: org/eclipse/jetty/server/Handler : Unsupported major.minor version 51.0

All the things I'm reading are basically saying "You're pointing at the wrong version of java"

And someone then said "Check your maven bin script, it's probably setting $JAVA_HOME incorrectly"

So I look and I see this:

OS specific support. $var must be set to either true or false.

cygwin=false;
darwin=false;
mingw=false
case "uname" in
CYGWIN_) cygwin=true ;;
MINGW_) mingw=true;;
Darwin*) darwin=true
#
# Look for the Apple JDKs first to preserve the existing behaviour, and then look
# for the new JDKs provided by Oracle.
#
if [[ -z "$JAVA_HOME" && -L /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK ]] ; then
#
# Apple JDKs
#
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
fi

       if [[ -z "$JAVA_HOME" && -L /System/Library/Java/JavaVirtualMachines/CurrentJDK ]] ; then
         #
         # Apple JDKs
         #
         export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home
       fi

       if [[ -z "$JAVA_HOME" && -L "/Library/Java/JavaVirtualMachines/CurrentJDK" ]] ; then
         #
         # Oracle JDKs
         #
         export JAVA_HOME=/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home
       fi            

       if [[ -z "$JAVA_HOME" && -x "/usr/libexec/java_home" ]] ; then
         #
         # Apple JDKs
         #
         export JAVA_HOME=/usr/libexec/java_home
       fi
       ;;

esac

Is there a way to fix how we set the java home so maven can work?


Reply to this email directly or view it on GitHub.

@petems
Copy link
Member Author

petems commented Jan 5, 2015

I dunno, that's all from the maven install done by default with brew...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant