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

OSX 8 still has JDK 6 available #18

Closed
ascheman opened this issue Dec 31, 2015 · 4 comments
Closed

OSX 8 still has JDK 6 available #18

ascheman opened this issue Dec 31, 2015 · 4 comments

Comments

@ascheman
Copy link

On OSX 8 (10.8.x) there is still a JDK 6 provided in /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK. Since .mvn/wrapper/maven-wrapper.jar was compiled with JDK 7, it cannot be loaded but raises the following exception:

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/wrapper/MavenWrapperMain : Unsupported major.minor version 51.0

I see two solutions to the problem:

  1. Change the search order in the mvnw wrapper script: search for newer Oracle JDKs (7 or 8) first since they can handle this (then completely drop JDK 6 for Darwin since it makes no sense!)
  2. Compile the Java classes with JDK 6 to enable running with older JDKs

I would prefer solution No. 2 since this would also allow to use the wrapper for legacy projects which rely on JDK 6 (yes, there are still some users of this out there in the dark!)

@abelsromero
Copy link

I am finding the same issue. I compiled the project setting the maven compiler to be compatible with 1.6 and it worked.

      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <configuration>
              <source>1.6</source>
              <target>1.6</target>
          </configuration>
      </plugin>

I know 1.6 is outdated, but I thing it could be done. The changes are minnor and it will help those arround still stuck with 1.6. wdyt?

@mosabua
Copy link
Member

mosabua commented Feb 11, 2016

I believe this PR #14 fixes the issue.

@abelsromero
Copy link

In the end I have created a fork and made the changes in my repo. TBH seems this is unmaintained.

hyoolim added a commit to perfectsense/brightspot-tutorial that referenced this issue Mar 10, 2017
@mosabua
Copy link
Member

mosabua commented Apr 10, 2017

Fixed with upcoming 0.2.0

@mosabua mosabua closed this as completed Apr 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants