从源 11.0 编译 netbeans 时出现的问题 [英] problems when compiling netbeans from source 11.0

查看:20
本文介绍了从源 11.0 编译 netbeans 时出现的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从源代码构建 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 第514话第515话

C:\Program Files\Netbeans\nbbuild\build.xml:509 :

506 第507话第508话509 第510话第511话

C:\Program Files\Netbeans\nbbuild\build.xml:556 :

537 <target name="build-one-cluster" until="${one.cluster.name}-is-built" depends="build-一簇检查">第538话第539话第540话第541话第542话第543话<!-- 我们在一个子项目中,所以需要重新插入目标... XXX <antcall>因此<重复>显然是从磁盘重新解析 Ant 脚本!-->第544话第545话第546话第547话第548话第549话第550话551 dest="${netbeans.dest.dir}"第552话553 固定模块 =${one-cluster-modules}"第 554 章第555话第556话第557话第558话第559话

C:\Program Files\Netbeans\nb\updatecenters\build.xml:44 :

44 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:我知道有二进制版本,方便很多,但是我很固执,想编译源版本哈哈

PS2:我更改了以下环境变量:JAVA_HOME、JAVA_PATH、ANT_HOME、PATH.

解决方案

根据所提供的信息很难说明您遇到问题的原因,但我遵循了

因此,简单地记录我所做的事情可能会更有帮助,您可以解决任何差异:

<块引用>

D:cd D:\下载\NetBeans 源\netbeans-masterC:\ApacheAnt\bin\ant 构建

注意事项:

  • 从源代码构建说明NetBeans 声明安装 Java 开发工具包的 LTS 版本",因此实际上您唯一的选择是 JDK 8 或 JDK 11.
  • 构建 NetBeans 会向控制台生成大量输出,因此最好将输出重定向到文件.这会加快一些速度,并且在您需要检查构建时会很有用.
  • 我没有 JAVA_PATH 环境变量.
  • Ant 文档 指出我们建议使用 1.10.x,除非您是需要在构建过程中使用 Java8 之前的 Java 版本.",因此请避免使用 Ant 1.9.x.

如果您仍然遇到问题,请使用以下信息更新您的问题:

  • 您对 JAVA_HOMEANT_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 of C:\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 the PATH.
  • Open a Command Prompt window and submit the following:

D:

cd D:\Downloads\NetBeans source\netbeans-master

C:\ApacheAnt\bin\ant build

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 and ANT_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 时出现的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆