问题描述
我正在尝试从源代码构建Netbeans 11.0,但遇到了一些问题.首先,我尝试使用JDK 13.02构建netbeans 11.0,但是出现了一些问题,并且我认为JDK版本不兼容,因此我下载了JDK 11.0.6版本,并且发生了相同的错误.因此,我下载了JDK 8u241版本,编译似乎可以正常进行,但是经过几分钟的编译,出现了下一个有趣的错误,这就是为什么我来这里寻求帮助.
构建失败C:\ Program Files \ Netbeans \ nbbuild \ build.xml:514:执行此行时发生以下错误:C:\ Program Files \ Netbeans \ nbbuild \ build.xml:509:执行此行时发生以下错误:C:\ Program Files \ Netbeans \ nbbuild \ build.xml:556:执行此行时发生以下错误:C:\ Program Files \ Netbeans \ nb \ updatecenters \ build.xml:44:exec返回:1总时间:32分28秒
我还包括了它显示的xml档案的代码行.
C:\ Program Files \ Netbeans \ nbbuild \ build.xml:514:
513<目标名称="build-clusters"取决于="init">514< run-depend-build clusters-to-build ="$ {nb.clusters.list}"/>515</target>
C:\ Program Files \ Netbeans \ nbbuild \ build.xml:509:
506<宏定义名称="run-depend-build">507< attribute name ="clusters-to-build"/>508< sequential>509< repeat target ="build-one-cluster" name ="one.cluster.name" values ="@ {clusters-to-build}"/>510</sequential>511</macrodef>
C:\ Program Files \ Netbeans \ nbbuild \ build.xml:556:
537<目标名称="build-one-cluster",除非="$ {one.cluster.name} -is-built"取决于="build-一类检查"538< echo message ="Building $ {one.cluster.name} modules"/>539<解析名称="one-cluster-modules" value ="$ {one.cluster.name}"/>540< resolve name ="one-cluster-dependencies" value ="$ {one.cluster.name} .depends"/>541< echo> $ {one-cluster-modules}</echo>542< echo>依赖关系:$ {one-cluster-dependencies}</echo>543<插入模块所有目标/><!-我们在子项目中,因此需要重新插入目标... XXX< antcall>因此< repeat>显然是从磁盘上重新解析了Ant脚本!->544< antcall target ="build-one-cluster-dependencies" InheritAll ="false">545< param name ="one.cluster.dependencies" value ="$ {one-cluster-dependencies}"/>546< param name ="one.cluster.name" value ="$ {one.cluster.name}"//>547< param name ="ext.binaries.downloaded" value ="true"/>548</antcall>549< mkdir dir ="$ {netbeans.dest.dir}"/>550< nbmerge failonerror ="$ {stop.when.broken.modules}"551 dest ="$ {netbeans.dest.dir}"552 topdir ="$ {nb_all}"553 fixedmodules ="$ {one-cluster-modules}"554 builtmodulesproperty ="$ {built.modules.property}"555 targetprefix ="all-"556 mergedependentmodules ="false">557</nbmerge>558< touch file ="$ {netbeans.dest.dir}/$ {one.cluster.name} .built"/>559</target>
C:\ Program Files \ Netbeans \ nb \ updatecenters \ build.xml:44:
.
C:\ ApacheAnt
而不是 C:\ ApacheAnt \ bin
,但是没有似乎很重要. C:\ Java \ jdk1.8.0_221
,并确保它是 PATH
上唯一的JDK./li>注意:
- 从源代码构建 说明NetBeans声明"安装Java开发工具包的LTS版本",因此实际上,您唯一的选择是JDK 8或JDK 11.
- 构建NetBeans会向控制台生成大量输出,因此最好将输出重定向到文件.这样可以加快速度,并且在您需要检查构建时会很有用.
- 我没有
JAVA_PATH
环境变量. - Ant文档声明"我们建议您使用1.10.x,除非您需要在构建过程中使用Java8之前的Java版本.",因此请避免使用Ant 1.9.x.
如果您仍然遇到问题,请使用以下信息更新您的问题:
- 您的
JAVA_HOME
和ANT_HOME
的设置. - 指向您遵循的有关构建NetBeans的说明的链接.
- 指向您用于下载NetBeans源的页面的链接.
- 从控制台提交
java -version
的输出.
I'm trying to building Netbeans 11.0 from source, and i'm having some problems. Firstly i've try to build the netbeans 11.0 with JDK 13.02 but some problems appeared and I believed that the JDK version was not compatible, so I downloaded the JDK 11.0.6 version and the same errors happened. So, I downloaded the JDK 8u241 version and the compilation finally seemed work, but, after minutes of compilation, the next intriguing error, which is why I come here to ask for help.
BUILD FAILED
C:\Program Files\Netbeans\nbbuild\build.xml:514: The following error occurred while executing this line:
C:\Program Files\Netbeans\nbbuild\build.xml:509: The following error occurred while executing this line:
C:\Program Files\Netbeans\nbbuild\build.xml:556: The following error occurred while executing this line:
C:\Program Files\Netbeans\nb\updatecenters\build.xml:44: exec returned: 1
Total time: 32 minutes 28 seconds
I also included the code lines of xml archives that it showed.
C:\Program Files\Netbeans\nbbuild\build.xml:514 :
513 <target name="build-clusters" depends="init">
514 <run-depend-build clusters-to-build="${nb.clusters.list}"/>
515 </target>
C:\Program Files\Netbeans\nbbuild\build.xml:509 :
506 <macrodef name="run-depend-build">
507 <attribute name="clusters-to-build"/>
508 <sequential>
509 <repeat target="build-one-cluster" name="one.cluster.name" values="@{clusters-to-build}" />
510 </sequential>
511 </macrodef>
C:\Program Files\Netbeans\nbbuild\build.xml:556 :
537 <target name="build-one-cluster" unless="${one.cluster.name}-is-built" depends="build-one-cluster-check">
538 <echo message="Building ${one.cluster.name} modules"/>
539 <resolve name="one-cluster-modules" value="${one.cluster.name}"/>
540 <resolve name="one-cluster-dependencies" value="${one.cluster.name}.depends"/>
541 <echo>${one-cluster-modules}</echo>
542 <echo>Dependencies: ${one-cluster-dependencies}</echo>
543 <insert-module-all-targets/> <!-- we are in a subproject, so need to reinsert the targets... XXX <antcall> and thus <repeat> apparently reparses the Ant script from disk! -->
544 <antcall target="build-one-cluster-dependencies" inheritAll="false">
545 <param name="one.cluster.dependencies" value="${one-cluster-dependencies}"/>
546 <param name="one.cluster.name" value="${one.cluster.name}"/>
547 <param name="ext.binaries.downloaded" value="true"/>
548 </antcall>
549 <mkdir dir="${netbeans.dest.dir}"/>
550 <nbmerge failonerror="${stop.when.broken.modules}"
551 dest="${netbeans.dest.dir}"
552 topdir="${nb_all}"
553 fixedmodules="${one-cluster-modules}"
554 builtmodulesproperty="${built.modules.property}"
555 targetprefix="all-"
556 mergedependentmodules="false">
557 </nbmerge>
558 <touch file="${netbeans.dest.dir}/${one.cluster.name}.built"/>
559 </target>
C:\Program Files\Netbeans\nb\updatecenters\build.xml:44 :
44 <exec executable="${java.home}/bin/keytool" failonerror="true">
45 <arg value="-exportcert"/>
46 <arg line="-keystore ${netbeans.bundled.ks}"/>
47 <arg line="-alias netbeans-bundled"/>
48 <arg line="-storepass ${netbeans.bundled.ks}"/>
49 <arg line="-file ${netbeans.bundled.cert}"/>
50 </exec>
PS1: I know that the binary version is available and it is much easier but I am stubborn and I want to compile the source version LOL
PS2: I made changes to the follow environment variables: JAVA_HOME, JAVA_PATH, ANT_HOME, PATH.
It's tough to state why you are having a problem based on the information provided, but I followed the Building from source instructions for NetBeans 11.3 on Windows 10 and everything worked:
Therefore it might be more helpful to simply document what I did, and you can address any differences:
- Download and unzip NetBeans 11.3 source from GitHub into
D:\Downloads\NetBeans source\netbeans-master
. - Download and unzip Ant 1.10.7 into
C:\ApacheAnt
. - I (incorrectly!) set ANT_HOME to
C:\ApacheAnt
instead ofC:\ApacheAnt\bin
, but it didn't seem to matter. - Set JAVA_HOME to
C:\Java\jdk1.8.0_221
, and ensure that it is the only JDK on thePATH
. - Open a Command Prompt window and submit the following:
Notes:
- The Building from source instructions for NetBeans state "Install an LTS release of the Java Development Kit", so effectively your only choices are JDK 8 or JDK 11.
- Building NetBeans generates a lot of output to the console, so it is probably better to redirect the output to a file. This will speed things up a bit, and will be useful if you need to review the build.
- I don't have a
JAVA_PATH
environment variable. - The Ant documentation states "We recommend using 1.10.x unless you are required to use versions of Java prior to Java8 during the build process.", so avoid using Ant 1.9.x.
If you continue to have problems then update your question with the following information:
- Your settings for
JAVA_HOME
andANT_HOME
. - A link to the instructions you followed for building NetBeans.
- A link to the page you used to download the source of NetBeans.
- The output from submitting
java -version
from the console.
这篇关于从源代码11.0编译Netbeans时出现的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!