Migrating apps to api3.8.0 and JDK11 with javaFX

30 views
Skip to first unread message

diyoyo

unread,
May 1, 2020, 10:08:32 AM5/1/20
to cytoscape-app-dev
Hi, 
is there a link to some documentation regarding new ways to build cytoscape app?

I have tried editing my pom.xml in order to use API 3.8.0, and compile with JDK 11.
Since my app was using JavaFX, I also tried to add the missing dependencies, but whatever I try, the app is no longer installed correctly by Cytoscape.

Here is how I changed the properties of the pom.xml header: 

<properties>
 
<cytoscape.api.version>3.8.0</cytoscape.api.version>
 
<maven-bundle-plugin.version>4.2.1</maven-bundle-plugin.version>
 
<osgi.api.version>6.0.0</osgi.api.version>
</properties>


and here are the dependencies I tried to add:

<dependency>
 
<groupId>org.openjfx</groupId>
 
<artifactId>javafx-base</artifactId>
 
<version>11</version>
</dependency>

<dependency>
 
<groupId>org.openjfx</groupId>
 
<artifactId>javafx-controls</artifactId>
 
<version>11</version>
</dependency>

<dependency>
 
<groupId>org.openjfx</groupId>
 
<artifactId>javafx-swing</artifactId>
 
<version>11</version>
</dependency>

<dependency>
 
<groupId>org.openjfx</groupId>
 
<artifactId>javafx-web</artifactId>
 
<version>11</version>
</dependency>

<dependency>
 
<groupId>org.openjfx</groupId>
 
<artifactId>javafx-graphics</artifactId>
 
<version>11</version>
</dependency>


Is that the right way?

Also, what should be the replacement for CySwingAppAdapter since its deprecation?

Thanks.

Cheers,

David Otasek

unread,
May 1, 2020, 4:04:20 PM5/1/20
to cytoscape-app-dev
There are a few different places where changes should be made.

The best thing to do would be to take a look at some of the commits that were done to our core apps:

A very basic example is here:

https://github.com/cytoscape/biopax/commit/cab4eca2f5c0083fb313799324c28a0dfb14dba9

The following is for an app the uses JavaFX, much like yours.

https://github.com/cytoscape/cyBrowser/commit/01a20600160a08b77261c8ae09beeef8f65201b0

https://github.com/cytoscape/cyBrowser/commit/e32145e23b788f96e41fed3ca6949c72fcab3948

Beyond those changes, unfortunately, it's on a case-by-case basis for making some dependencies behave correctly. Checking that you're using more recent versions using the maven versions plugin can be helpful in this: https://www.mojohaus.org/versions-maven-plugin/examples/display-dependency-updates.html

If you run cytoscape.bat or cytoscape.sh from the terminal, the output there might also give you some indication of what is failing.

diyoyo

unread,
May 1, 2020, 5:05:11 PM5/1/20
to cytoscape-app-dev
Thanks, 
I had made a few errors in the different version.
I finally got to use the cytoscape.sh and the error is the following:

Caused by: java.lang.IllegalAccessError: Class javafx/application/Platform(unnamed module 0x00000007EEDC3740) can not access class com/sun/javafx/application/PlatformImpl(module javafx.graphics) because module module javafx.graphics does not export package com/sun/javafx/application to module unnamed module 0x00000007EEDC3740





Do you know how to fix this, by any chance?

I haven't followed the latest JavaFX updates, I'm not sure where to start.

Thanks.

diyoyo

unread,
May 1, 2020, 5:50:57 PM5/1/20
to cytoscape-app-dev
Ok, I got it to work: I was actually trying to pre-bundle javafx in one of the dependency of my cytoscape app. I guess it was clashing with the pre-installed javafx of cytoscape.
I removed it from my library and now it works.
Reply all
Reply to author
Forward
0 new messages