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

OSX 8 still has JDK 6 available #18

@ascheman

Description

@ascheman

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!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions