JDK7 with lambda's downloadable
Howard Lovatt
howard.lovatt at gmail.com
Fri Sep 10 18:06:56 PDT 2010
The following works for me on a Mac (you need Snow Leopard):
Stage 1: Get a MLVM
================
Download latest MLVM from http://www.concord.org/~sbannasch/mlvm/
(currently java-1.7.0-internal-mlvm-2010_09_06.tar.gz)
Go into /System/Library/Frameworks/JavaVmFramework/Version
Duplicate the directory 1.6.0
Rename to 1.7.0_2010_09_06 (or whatever the latests MLVM version date is)
Go into 1.7.0_2010_09_06 and delete the directory Home
Copy java-1.7.0-internal-mlvm-2010_09_06.tar.gz into 1.7.0_2010_09_06
Expand java-1.7.0-internal-mlvm-2010_09_06.tar.gz and rename the
expanded director to Home
Stage 2: Get JDK 7 (you need mercurial, a.k.a. hg, from http://www.macports.org)
===========================================================
Go to a directory where you want to install JDK7
hg clone http://hg.openjdk.java.net/lambda/lambda/langtools
Stage 3: Compile JDK 7 (this is the script I use - note the cd line is
correct only for my directory structure)
==============================================================================
#!/bin/sh
# Pull latest JDK 7 build and compile all the tools (incl. javac)
jdk=/System/Library/Frameworks/JavaVM.framework/Versions/1.7.0_2010_09_06/Home
# Get latest
cd ../../../../JDK7/langtools/
hg pull -u
# Build tools
cd make
ant -Dboot.java.home=$jdk -Dtarget.java.home=$jdk build-all-tools
Stage 4: Compile and run your code (this is the script I use - note
the cd lines etc. are correct for a Netbeans directory structure)
=============================================================================================
#!/bin/sh
# Compile and run Lambda examples
jdk=/System/Library/Frameworks/JavaVM.framework/Versions/1.7.0_2010_09_06/Home/bin
javac=/Users/lov080/Dropbox/Personal/Java/JDK7/langtools/dist/lib/javac.jar
guava=/Users/lov080/Dropbox/Personal/Java/GuavaLibrariesGoogleCollectionsAPI/guava-r05/guava-r05.jar
package=lambdas
# Compile (javac)
cd ..
rm ../build/classes/$package/*
$jdk/java -Xbootclasspath/p:$javac -ea -jar $javac \
-g -deprecation -cp .:$guava -source 7 -Xlint:all
-XDallowFunctionTypes -d ../build/classes \
$package/*.java
# Run
cd ../build/classes
$jdk/java -cp .:$guava:$javac -ea -Xfuture \
-XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles
-XX:+EnableInvokeDynamic \
-XX:SuppressErrorAt=/constantPoolOop.cpp:283 \
$package.Main
-- Howard.
More information about the lambda-dev
mailing list