上有NullPointerException我有下一個問題。當我從NetBeans IDE運行項目時,evrything很好。但是,當我試圖建立的項目,我有例外:Java項目正在運行,但是當我嘗試構建它時,我在startWith(NetBeans)
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不是null。我能不明白的地方是一個錯誤:(
我最初並不是JAVA程序員,我想,我必須閱讀一些關於它的書籍以進一步編程:) – Leonid
看這裏http://stackoverflow.com/questions/4128256/change- jre-in-netbeans-project – zacheusz
全部完成 JRE 1.6只有兩個註釋: AppNormaliser.java使用未選中或不安全的操作操作。 注意:使用-Xlint重新編譯:取消選中以獲取詳細信息。 – Leonid