lambda binary snapshots

Nabeel Ali Memon nabeelalimemon at gmail.com
Sat Nov 19 04:00:57 PST 2011


Thanks a lot Brian. It worked but, just to add to the archive, one needs to specify asm version 4.0RC1in build file or either rename the jar to asm-all-4.0.jar in lib folder.

Sent from my iPad

On Nov 19, 2011, at 14:01, Brian Goetz <brian.goetz at oracle.com> wrote:

> You need to download ASM and TestNG and drop the jars in the lib directory. Look in the ant file for the exact versions required.  
> 
> Sent from my iPhone
> 
> On Nov 19, 2011, at 10:29 AM, Nabeel Ali Memon <nabeelalimemon at gmail.com> wrote:
> 
>> Thanks Robert. It looks much simpler but is there any simple how-to to build defender-prototype repository from source?
>> 
>> Intuitively, I downloaded the latest source archive (of lambda/defender-prototype) from http://hg.openjdk.java.net/ and ran 'ant distrib' (or 'ant') but it gave me the following error:
>> 
>> "…build.xml:44: taskdef class org.testng.TestNGAntTask cannot be found"
>> 
>> 
>> Nabeel
>> 
>> On Nov 15, 2011, at 1:28 AM, Robert Field wrote:
>> 
>>> Thanks Mike.
>>> 
>>> There are two ways to use the defender prototype weaver: the batch 
>>> pre-weaving approach with Mike describes, or the Java agent, which does 
>>> not use a two step process.  Just add the needed classpath and javaagent 
>>> options to your 'java' command and it will simulated how the VM would work.
>>> 
>>> To use the Java agent:
>>> 
>>>    java    -cp   .:<defender-prototype>/lib/asm-all-4.0.jar     
>>> -javaagent:<defender-prototype>/distrib/jsr335-agent.jar <your-main-class>
>>> 
>>> Where:
>>> <defender-prototype> is the location of the built defender-prototype 
>>> repository.
>>> 
>>> Note: you will need the very latest defender-prototype (today) for this 
>>> to work
>>> 
>>> Note: you need to add the classpath <your-main-class> needs to the -cp 
>>> command (and that the delimiter is ';' on windows).
>>> 
>>> Enjoy,
>>> Robert
>>> 
>>> 
>>> 
>>> On 11/12/11 09:06, Mike Duigou wrote:
>>>> Here's a version of the weaving instructions:
>>>> 
>>>> In order to test the lambda functional interfaces it's necessary to pre-link the extension methods aka "weaving" for classes which inherit extension methods..
>>>> 
>>>> The current lambda workspace will weave rt.jar if the defender prototype weaver is located in a peer directory:
>>>> 
>>>> ~/
>>>> code/
>>>>     jdk8/
>>>>         defender-prototype/ (http://hg.openjdk.java.net/lambda/defender-prototype/)
>>>>         lambda/ (http://hg.openjdk.java.net/lambda/lambda)
>>>> 
>>>> If you are writing code which uses extension methods or implements interfaces with extension methods you will need to weave those classes before running using current VMs. The weaver can weave either a directory or a jar to another jar or directory. It can't weave in-place. This is the command used to weave rt.jar:
>>>> 
>>>> $(BOOT_JAVA_CMD) -cp ../../../../defender-prototype/distrib/jsr335-agent.jar:../../../../defender-prototype/lib/asm-all-4.0.jar jsr335.agent.batch.Main -v -d rt.jar rt-preweave.jar
>>>> 
>>>> source (-d) is rt-preweave.jar
>>>> destination (parameter) is rt.jar
>>>> 
>>>> Once woven the classes will be usable with current JVMs including the one provided in the lambda binary snapshot.
>>>> 
>>>> The defender prototype currently requires
>>>> 
>>>> TestNG 6.2 or 6.3 (both seem to work)
>>>> Asm 4.0 RC 1<-- *Important* Other versions won't work due to API changes.
>>>> 
>>>> Mike
>>>> 
>>>> On Nov 12 2011, at 07:48 , Brian Goetz wrote:
>>>> 
>>>>> Good question.  It is currently pretty limited.  The compiler accepts interfaces with extension methods and enforces the typing rules, and emits correct class files.  The VM support for inheriting behavior from interfaces is not there yet. But, we do have a prototype tool for simulating the VM behavior through bytecode weaving, and the build for this binary download runs this weaving tool on the JDK libraries, so that the few extension methods that are in the libraries behave correctly in the JDK classes.  So, for example, the extension methods from Iterable will show up on JDK implementations of Iterable like ArrayList, but not on a custom user implementation of List (yet).
>>>>> 
>>>>> The weaving tool is open-source but not part of this binary distribution. We plan to post instructions for trying it out if you want to use extension methods in your own code.
>>>>> 
>>>>> 
>>>>> On Nov 12, 2011, at 4:10 PM, Colin Decker wrote:
>>>>> 
>>>>>> Thanks for putting out these snapshots!
>>>>>> 
>>>>>> To what degree are extension methods supposed to be working in this build?
>>>>>> They seem to work for subclasses of Iterable, except those that were
>>>>>> compiled with a previous version of Java, for which I get an
>>>>>> AbstractMethodError. I also tried adding extension methods to an interface
>>>>>> of my own... it compiles, but gives an AbstractMethodError as well.
>>>>>> 
>>>>>> -- 
>>>>>> Colin
>>>>>> 
>>>>>> 
>>>>>> On Fri, Nov 11, 2011 at 12:27 PM, Maurizio Cimadamore<
>>>>>> maurizio.cimadamore at oracle.com>  wrote:
>>>>>> 
>>>>>>> Dear lambditizens,
>>>>>>> I'm glad to announce that the first binary snapshots of the lambda
>>>>>>> repository are available at the following URL:
>>>>>>> 
>>>>>>> http://jdk8.java.net/lambda/
>>>>>>> 
>>>>>>> As you can imagine, as the implementation of the compiler/libraries is
>>>>>>> still under heavy development, there are still many rough corners that
>>>>>>> need to be polished. I'd like to thank you all for all the patience and
>>>>>>> the valuable feedback provided so far - please keep it coming!
>>>>>>> 
>>>>>>> I'd also like to thank Brian, Dan, Mike, Stuart and Mike for their
>>>>>>> effort in making this happen.
>>>>>>> 
>>>>>>> Enjoy.
>>>>>>> 
>>>>>>> Maurizio
>>>>>>> 
>>>>>>> 
>>>>> 
>>>> 
>>> 
>>> 
>> 
>> 


More information about the lambda-dev mailing list