gpt4 book ai didi

Java 项目正在运行,但是当我尝试构建它时,在startsWith (NetBeans) 处出现 NullPointerException

转载 作者:行者123 更新时间:2023-12-01 15:48:21 25 4
gpt4 key购买 nike

我有一个下一个问题。当我从 NetBeans IDE 运行项目时,一切都很好。但是当我尝试构建项目时,我遇到了异常(exception):

Compiling 2 source files to D:\JAVA\Projects\streamer\build\classes
An exception has occurred in the compiler (1.7.0-ea). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.NullPointerException
at java.lang.String.startsWith(String.java:1433)
at java.lang.String.startsWith(String.java:1462)
at com.sun.tools.javac.file.SymbolArchive.addZipEntry(SymbolArchive.java:49)
at com.sun.tools.javac.file.ZipArchive.<init>(ZipArchive.java:63)
at com.sun.tools.javac.file.SymbolArchive.<init>(SymbolArchive.java:41)
............
D:\JAVA\Projects\streamer\nbproject\build-impl.xml:603: The following error occurred while executing this line:
D:\JAVA\Projects\streamer\nbproject\build-impl.xml:245: Compile failed; see the compiler error output for details.

我没有使用 String.startsWith 方法,但我在一处使用 String.indexOf :

int lastIndex = nodeName.indexOf("date",0);
if (lastIndex != -1 || nodeName.equals("birthday")) {
txt_val = getHash(txt_val,Boolean.TRUE);
} else {
txt_val = getHash(txt_val,Boolean.FALSE);
}

nodeName 不为空。我不明白哪里有错误:(

最佳答案

您是故意使用 Java 7 的吗?尝试 Java 6 - 它应该更稳定。看这里Change JRE in NetBeans project

关于Java 项目正在运行,但是当我尝试构建它时,在startsWith (NetBeans) 处出现 NullPointerException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6662003/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com