Leonid
Leonid

Reputation: 92

Java project was running, but when I'm trying to build it I have NullPointerException at startsWith (NetBeans)

I have a next problem. When I'm running project from NetBeans IDE evrything is fine. But when I'm trying to build the project I have 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.

I'm not use String.startsWith method, but I'm use String.indexOf in one place:

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 is not null. And I couldn't understand where is an error :(

Upvotes: 0

Views: 619

Answers (2)

zacheusz
zacheusz

Reputation: 8842

Did you use Java 7 intentionally? Try Java 6 - it should be more stable. Look here Change JRE in NetBeans project

Upvotes: 1

Eduard
Eduard

Reputation: 3216

Error is in compiler like the exception sayes. Why are you using java 1.7?

Upvotes: 0

Related Questions