Can't get lambda forest to work

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Mon Jun 14 09:22:14 PDT 2010


On 14/06/10 17:19, Maurizio Cimadamore wrote:
> I can run your example with no problems. Which version of JDK 7 are you
> using? Could it be a not too recent one? I'm using b94.
>    
Nevermind - you are using the latest one, since you are calling 'java' 
from the repo you've just built :-)

Maurizio
> In order to get the scripts I'm talking about follows the following steps:
>
> 1) cd<ROOT>/langtools
> 2) ant build-all-tools
>
> Note: step 2 might require changes to the build.properties file under
> langtools/make (e.g. you need to point to a valid JDK 6 for compiling
> the langtools repository, and then set a valid JDK 7 distro for
> launching the new javac).
>
> Maurizio
>
> On 14/06/10 17:12, Jonathan Gibbons wrote:
>    
>> On 06/14/2010 09:00 AM, Andrew Haley wrote:
>>
>>      
>>> On 06/14/2010 04:53 PM, Maurizio Cimadamore wrote:
>>>
>>>
>>>        
>>>> On 14/06/10 16:25, Andrew Haley wrote:
>>>>
>>>>
>>>>          
>>>>> This is rev 179:d923ba684bc4 of http://hg.openjdk.java.net/lambda/lambda
>>>>>
>>>>> It doesn't seem to work.  I compile
>>>>>
>>>>> public class Closures
>>>>> {
>>>>>       public static void main(String[] args)
>>>>>       {
>>>>>         #int() fortyTwo = #()(42);
>>>>>
>>>>>         System.out.println("Hello, World!" + fortyTwo.());
>>>>>       }
>>>>> }
>>>>>
>>>>> but it doesn't run:
>>>>>
>>>>> happy:~ $ /local/lambda/build/linux-amd64/j2sdk-image/bin/javac
>>>>> -XDallowFunctionTypes -source 7 Closures.java
>>>>> happy:~ $ /local/lambda/build/linux-amd64/j2sdk-image/bin/java
>>>>> -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles  -cp . Closures
>>>>> OpenJDK 64-Bit Server VM warning: JSR 292 invokedynamic is disabled in
>>>>> this JVM.  Use -XX:+UnlockExperimentalVMOptions
>>>>> -XX:+EnableInvokeDynamic to enable.
>>>>> Exception in thread "main" java.dyn.NoAccessException: cannot access:
>>>>> *.java.dyn.MethodHandle.invoke()int
>>>>>             at sun.dyn.MemberName.newNoAccessException(MemberName.java:421)
>>>>>             at sun.dyn.MemberName.newNoAccessException(MemberName.java:412)
>>>>>             at sun.dyn.MemberName$Factory.resolveOrFail(MemberName.java:517)
>>>>>             at
>>>>> java.dyn.MethodHandles$Lookup.findVirtual(MethodHandles.java:268)
>>>>>             at sun.dyn.Invokers.exactInvoker(Invokers.java:66)
>>>>>             at sun.dyn.Invokers.genericInvoker(Invokers.java:74)
>>>>>             at java.dyn.MethodHandle.invokeVarargs(MethodHandle.java:354)
>>>>>             at Closures.main(Closures.java:7)
>>>>> happy:~ $ /local/lambda/build/linux-amd64/j2sdk-image/bin/java -version
>>>>> openjdk version "1.7.0-internal"
>>>>> OpenJDK Runtime Environment (build
>>>>> 1.7.0-internal-aph_2010_06_10_17_35-b00)
>>>>> OpenJDK 64-Bit Server VM (build 19.0-b01, mixed mode)
>>>>>
>>>>> Any ideas what might be going wrong, please?
>>>>>
>>>>>
>>>>>
>>>>>            
>>>> You'll need the following VM options:
>>>>
>>>> -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles
>>>> -XX:+EnableInvokeDynamic
>>>>
>>>>
>>>>          
>>> Thanks.  As I said in my previous reply, that doesn't help:
>>>
>>> happy:~ $ /local/lambda/build/linux-amd64/j2sdk-image/bin/java  -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles -XX:+EnableInvokeDynamic -cp . Closures
>>> Invalid layout of java.dyn.CallSite at target
>>> #
>>> # A fatal error has been detected by the Java Runtime Environment:
>>> #
>>> #  Internal Error (javaClasses.cpp:48), pid=10544, tid=14015271442
>>>
>>>
>>>
>>>        
>>>> alternatively, you could use the handy scripts for invoking java/javac
>>>> that should appear in the langtools/dist/bin directory. Those scripts
>>>> automatically sets things up for you.
>>>>
>>>>
>>>>          
>>> Thanks, but I can't find those at all.  I can find
>>>
>>> /local/lambda/langtools/src/share/bin/java.sh-template
>>>
>>> which I guess must be what you mean, but no output file.
>>>
>>> Andrew.
>>>
>>>
>>>
>>>        
>> The langtools dist/bin/* files are only created in langtools "developer
>> build" mode, and not in "full JDK build" mode, which you have done.  If
>> you wanted to build those files, you'd have to go to langtools and drive
>> "make" or Ant directly, using an Ant target like build-all-tools. But,
>> nothing there will help with the fatal runtime error you have uncovered.
>> Sorry.
>>
>> -- Jon
>>
>>
>>      
>
>    



More information about the lambda-dev mailing list