retrolambda
Kevin Rushforth
kevin.rushforth at oracle.com
Wed Jun 4 19:23:02 UTC 2014
The FX build already relies on the fact that jfxrt.jar is removed from
the JDK with which you build. In fact, the build should detect and fail
if this is not the case.
-- Kevin
Johan Vos wrote:
> As a follow-up on this: I managed to run the retrolambda process in the
> gradle build for each module (rather than in the end unpacking everything).
> There is still the issue with jfxrt.jar on the classpath. Since it is in
> the ext directory, I can't remove it by specifying the Xbootclasspath. I
> tried to prepend the Xbootclasspath in the retrolambda process with the
> classes generated by openjfx, but in that case, they are loaded by the
> System classloader and ignored by retrolambda.
>
> I'll try to discuss this in the retrolambda project.
>
> In theory, I could move jre/lib/ext/jfxrt.jar to some temporary directory,
> run retrolambda and move jfxrt.jar back, but that requires root access in
> most cases and it is very ugly.
>
> Is there a better way to ignore the jfxrt.jar in the Java 8 SDK?
>
> - Johan
>
>
> 2014-05-02 11:43 GMT+02:00 Johan Vos <johan at lodgon.com>:
>
>
>> Hi,
>>
>> I was able to refactor all lambda's out of the class files of jfxrt.jar
>> using RetroLambda 1.1.5-SNAPSHOT.jar (after adding the eclipse swt jar to
>> the classpath and removing jfxrt.jar from the bootclasspath).
>>
>> This means that the builds for platforms that don't support invokedynamic
>> should be able to work with the OpenJFX code base.
>> I'll try to add the retrolambda gradle plugin somehow in the openjfx
>> gradle system. As I'm not an expert with gradle, some help would be
>> appreciated.
>>
>> At this moment, I simply unzipped the jfxrt.jar, removed the jfxrt.jar
>> from the lib/ext directory in the Java 8 install, and executed
>>
>> java -Dretrolambda.inputDir=class
>> -Dretrolambda.classpath=class:org.eclipse.swt.gtk.linux.x86_64_3.7.2.v3740f-.jar
>> -Dretrolambda.outputDir=retroclass -javaagent:retrolambda.jar -jar
>> retrolambda.jar
>>
>>
>> It should be possible to optionally do this retrocompiling task during the
>> build of OpenJFX. In my JavaFX-Android applications, I use
>> gradle-retrolambda as follows:
>> buildscript {
>> repositories {
>> mavenCentral()
>> }
>>
>> dependencies {
>> classpath 'me.tatarka:gradle-retrolambda:1.3.0'
>> }
>> }
>> ...
>> apply plugin: 'retrolambda'
>>
>> - Johan
>>
>>
More information about the openjfx-dev
mailing list