RFR: 7113349 JDK8 port to macosx

Henri Gomez henri.gomez at gmail.com
Wed Mar 14 12:56:56 PDT 2012


Well, I tried some Java 8 samples like :

public class Sample4 {

  enum Decision {
    APPROVE, DECLINE, APPROVE_REFER
  }

  interface DecisionService {
    Decision getRiskDecision(Applicant applicant);
  }

  class Applicant {
    private int score;

    public Applicant(int score) {
      this.score = score;
    }

    public int getScore() {
      return score;
    }
  }

  public void test() {
    DecisionService cs = (a) -> {
    if (a.getScore() > 700) {
      return Decision.APPROVE;
    } else if (a.getScore() > 600 && a.getScore() < 650) {
      return Decision.APPROVE_REFER;
    } else {
      return Decision.DECLINE;
    }};
    Decision decision = cs.getRiskDecision(new Applicant(800));
    System.out.println(decision.toString());
  }

  public static void main(String... args) {
    new Sample4().test();
  }
}

But it fail to build ;(

Sample4.java:24: error: lambda expressions are not supported in -source 1.8
   DecisionService cs = (a) -> {
                            ^
 (use -source 8 or higher to enable lambda expressions)

Tried to force -source 8, no more luck.

Any Lamba guru around ? :)


2012/3/14 Scott Kovatch <scott.kovatch at oracle.com>:
> This is great to see! Thanks for doing that!
>
> ----------------------------------------
> Scott Kovatch
> scott.kovatch at oracle.com
> Santa Clara/Pleasanton, CA
>
> On Mar 14, 2012, at 9:01 AM, Henri Gomez wrote:
>
> Well I'm using mainly same stuff except I added :
>
> ALT_BOOTDIR=`/usr/libexec/java_home -v 1.7`
>
> A fresh OpenJDK 8 for OSX has been released :
>
> http://openjdk-osx-build.googlecode.com/files/OpenJDK-OSX-8-x64-jdk-b29-20120314.dmg
>
> Cheers
>
> 2012/3/14 Mike Swingler <swingler at apple.com>:
>
> They should be the same ones as what is on the
> <https://wikis.oracle.com/display/OpenJDK/Mac+OS+X+Port> wiki page...it's
> just a different repo. I haven't tried it yet, but if you have any issues,
> here is the place to discuss them.
>
>
> Regards,
>
> Mike Swingler
>
> Apple Inc.
>
>
> On Mar 14, 2012, at 5:59 AM, Henri Gomez wrote:
>
>
> Good news.
>
>
> Could you recall us the recommended/official build command lines ?
>
>
> 2012/3/14 Alan Bateman <Alan.Bateman at oracle.com>:
>
> On 03/03/2012 14:31, Alan Bateman wrote:
>
>
> On 03/03/2012 14:14, Henri Gomez wrote:
>
>
> Guys could you detail JDK8 build process on OSX ?
>
>
> I'd like to add this to my openjdk-osx-build project.
>
>
> Thanks
>
>
> The Mac port isn't in jdk8 yet but should be very soon. The webrev that
>
> Michael sent a link to is just part of the process to get the changes agreed
>
> before he pushes it to the jdk8/tl forest, something that I hope will happen
>
> within a few days. All going well it should mean the Mac port should get to
>
> the jdk8 master in a few weeks (exactly when it's clearly but I assume it
>
> will bake in jdk8/tl for a bit).
>
>
> Just to follow up on this thread. Lana pushed the Mac port to the jdk8
>
> master yesterday so you should be able to clone jdk8/jdk8 and do your stuff
>
> (with a jdk7 build as the bootstrap JDK and working around the gamma
>
> launcher issue).
>
>
> -Alan
>
>
>


More information about the macosx-port-dev mailing list