On 10/4/19 9:42 AM, mlist wrote:
Even that results in the same failure.
I also had trouble building NetBeans, even though I've been building the
JDK and JavaFX for years. I am very new to the NetBeans source code,
though. Here's what I did to get it working. I'm on Ubuntu 16.04.6 LTS.
STEPS
(1) If you're getting persistent errors, start over with a new clone of
the repository. For example, I switched back and forth between JDK 8 and
JDK 11 for the build, but it seems that some remaining files -- even
after a "clean" -- can leave the build (or me) hopelessly confused.
(2) Download the Apache Ant 1.10.7 binary archive and its signatures:
apache-ant-1.10.7-bin.tar.gz
apache-ant-1.10.7-bin.tar.gz.asc
apache-ant-1.10.7-bin.tar.gz.sha512
Calm any fears of installing software not in your official Linux
distribution by verifying the binary archive as follows:
$ gpg --verify apache-ant-1.10.7-bin.tar.gz.asc
...
gpg: Good signature from "jaikiran@apache <[email protected]>"
...
$ shasum -c apache-ant-1.10.7-bin.tar.gz.sha512
apache-ant-1.10.7-bin.tar.gz: OK
Unpack the archive into "~/opt/apache-ant-1.10.7".
(3) Create the following Bash script, name it "nbbuild.sh", and put it
in your "~/bin" directory. You will need to change the location of the
JDK 8 directory (jdk8) on your system, and perhaps the location of
ANT_HOME if you didn't put Ant 1.10.7 in "~/opt". The JDK 11 variables
are commented out and are not used, so don't worry about them. Also note
that I'm building just the "basic" cluster.
-----------
#!/bin/bash
# Builds the Apache NetBeans IDE with JDK 8 or 11
trap exit INT TERM
set -o errexit
# Ubuntu OpenJDK 8 and AdoptOpenJDK 11
jdk8="/usr/lib/jvm/java-8-openjdk-amd64"
jdk11="$HOME/opt/jdk-11.0.4+11"
# For JDK 8
export JAVA_HOME=$jdk8
options="-Dcluster.config=basic -Dnbjdk.home=$jdk8"
# For JDK 11
#export JAVA_HOME=$jdk11
#options="-Dcluster.config=basic -Dnbjdk.home=$jdk11 \
# -Dpermit.jdk9.builds=true"
# Calls Apache Ant
export ANT_HOME=$HOME/opt/apache-ant-1.10.7
export PATH=$ANT_HOME/bin:$JAVA_HOME/bin:/usr/sbin:/usr/bin:/sbin:/bin
java -version
ant -version
echo ant $options $@
-----------
(4) You should see the following output when you run the script:
-----------
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-8u222-b10-1ubuntu1~16.04.1-b10)
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)
Apache Ant(TM) version 1.10.7 compiled on September 1 2019
ant -Dcluster.config=basic -Dnbjdk.home=/usr/lib/jvm/java-8-openjdk-amd64
-----------
(5) Now remove the "echo" from the last line of the script file. Change
to the root of a clean NetBeans Git repository and try building with:
$ ~/bin/nbbuild.sh
RESULT
Those steps build NetBeans successfully for me with JDK 8, which was
good enough to let me even debug a NetBeans module.
REMAINING MYSTERIES
(1) When I try the same script with JDK 11, I get a compilation error:
[javac]
/home/john/tmp/github/jgneff/netbeans/ide/db/build/fake-jdbc-40/src/java/sql/RowIdLifetime.java:2:
error: package exists in another module: java.sql
(2) When I pull the NetBeans Build System project (netbeans/nbbuild)
into the latest NetBeans 11.2, I get one file flagged with an error:
File: nbbuild/antsrc/org/netbeans/nbbuild/ReleaseJsonProperties.java
Error: package org.json.simple does not exist
(3) I'm not sure when or how the file "nbbuild/user.build.properties" is
created. Sometimes I get the file, other times I don't, and I'm not sure
whether it matters.
(4) I also created the file "~/.nbbuild.properties" with the following
properties, just in case, but I don't think it's necessary if the
properties are defined on the "ant" command line.
-----------
# For JDK 8
nbjdk.home=/usr/lib/jvm/java-8-openjdk-amd64
# For JDK 11
# nbjdk.home=/home/john/opt/jdk-11.0.4+11
# permit.jdk9.builds=true
-----------
John
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists