[ 
https://issues.apache.org/jira/browse/NETBEANS-3329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16968607#comment-16968607
 ] 

John Neffenger commented on NETBEANS-3329:
------------------------------------------

h2. {anchor:building-openjfx}Building OpenJFX

Thanks to all the work that Laszlo has done, I think we're pretty close to 
getting this working! In the meanwhile, I've been breaking out the JavaFX 
modules into their own separate NetBeans Ant projects. For example, I'm working 
on the JavaFX Graphics module in the Ant-based project at 
[jgneff/javafx-graphics|https://github.com/jgneff/javafx-graphics].

In the description below, first I show how to build OpenJFX outside of NetBeans 
from the command line; then I show how to build it from within NetBeans.

h3. {anchor:from-the-command-line}From the command line

Outside of NetBeans, it's just a matter of using specific versions of Ant, 
Gradle, and the JDK, and running one command to install all of the build 
dependencies. I use the following instructions to build OpenJFX on Ubuntu 16.04 
and 18.04, and I just verified them again on a new LXD container install of 
Ubuntu 18.04.

Download [AdoptOpenJDK 
12.0.2|https://adoptopenjdk.net/releases.html?variant=openjdk12&jvmVariant=hotspot],
 [Apache Ant 1.10.7|https://ant.apache.org/bindownload.cgi], and [Gradle 
5.6.4|https://gradle.org/releases/] into {{~/tmp}}.

{code}
~/tmp/OpenJDK12U-jdk_x64_linux_hotspot_12.0.2_10.tar.gz
~/tmp/OpenJDK12U-jdk_x64_linux_hotspot_12.0.2_10.tar.gz.sha256.txt
~/tmp/apache-ant-1.10.7-bin.tar.gz
~/tmp/apache-ant-1.10.7-bin.tar.gz.sha512
~/tmp/gradle-5.6.4-bin.zip
~/tmp/gradle-5.6.4-bin.zip.sha256
{code}

Unpack the archives into {{~/opt}}.

{code}
~/opt/apache-ant-1.10.7
~/opt/gradle-5.6.4
~/opt/jdk-12.0.2+10
{code}

Put the following Bash script in {{~/bin}}.

h4. {anchor:binjfxenvsh}~/bin/jfxenv.sh

{code:Bash}
#!/bin/bash
# Sets up the environment for building OpenJFX
syspath=/usr/sbin:/usr/bin:/sbin:/bin

# JDK_HOME and PATH are required by the build
export JDK_HOME=$HOME/opt/jdk-12.0.2+10
export JAVA_HOME=$JDK_HOME
export GRADLE_HOME=$HOME/opt/gradle-5.6.4
export ANT_HOME=$HOME/opt/apache-ant-1.10.7
export PATH=$ANT_HOME/bin:$GRADLE_HOME/bin:$JDK_HOME/bin:$syspath
{code}

Verify the environment.

{code}
$ source ~/bin/jfxenv.sh

$ java -version
openjdk version "12.0.2" 2019-07-16
OpenJDK Runtime Environment AdoptOpenJDK (build 12.0.2+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 12.0.2+10, mixed mode, 
sharing)

$ ant -version
Apache Ant(TM) version 1.10.7 compiled on September 1 2019

$ gradle -version

------------------------------------------------------------
Gradle 5.6.4
------------------------------------------------------------

Build time:   2019-11-01 20:42:00 UTC
Revision:     dd870424f9bd8e195d614dc14bb140f43c22da98

Kotlin:       1.3.41
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.14 compiled on March 12 2019
JVM:          12.0.2 (AdoptOpenJDK 12.0.2+10)
OS:           Linux 4.15.0-66-generic amd64

{code}

Install the build dependencies. If you get the following error, uncomment the 
{{deb-src}} entries in {{/etc/apt/sources.list}} and try again.

{code}
$ sudo apt-get build-dep openjfx
Reading package lists... Done
E: You must put some 'source' URIs in your sources.list
{code}

Clone the OpenJFX repository into {{~/src}}.

{code}
$ git clone https://github.com/openjdk/jfx.git
Cloning into 'jfx'...
{code}

Build OpenJFX.

{code}
$ cd src/jfx
$ source ~/bin/jfxenv.sh
$ gradle sdk jmod
...
BUILD SUCCESSFUL in 1m 52s
134 actionable tasks: 134 executed
{code}

h3. {anchor:from-within-netbeans}From within NetBeans

To build OpenJFX from NetBeans, modify your NetBeans configuration to use JDK 
12 as the default Java Platform.

h4. 
{anchor:snapnetbeanscommondata112etcnetbeansconf}~/snap/netbeans/common/data/11.2/etc/netbeans.conf

{code}
netbeans_jdkhome="/home/john/opt/jdk-12.0.2+10"
{code}

!java-version.png!

Set up NetBeans to use the Custom Gradle Distribution of Gradle version 5.6.4, 
and un-check the item, "Prefer to use Gradle Wrapper that Comes with the 
Project."

!gradle-version.png!

Also change the Ant version in NetBeans to use the latest Apache Ant version 
1.10.7.

!ant-version.png!

Load the _jfx_ project in NetBeans and press the _Clean and Build Project_ 
button. It builds successfully!

Right-click the _jfx:graphics_ sub-project and select _Open Project_. The 
sub-project actually builds successfully, but the Notification Window shows an 
Unexpected Exception. I'll post the exceptions in my next comment.


> Exception loading OpenJFX gradle project
> ----------------------------------------
>
>                 Key: NETBEANS-3329
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-3329
>             Project: NetBeans
>          Issue Type: Bug
>         Environment: macOS 10.15
> JDK 12.0.2
>            Reporter: Scott Palmer
>            Priority: Major
>         Attachments: ant-version.png, gradle-version.png, java-version.png, 
> messages.log
>
>
> Loading the OpenJFX project and then the "controls" sub-project lead to 
> exceptions and the controls project showing red error markers.
>  IDE log attached.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to