This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Product Version = NetBeans IDE 7.1.2 (Build 201204101705) Operating System = Windows 7 version 6.1 running on x86 Java; VM; Vendor = 1.7.0_03 Runtime = Java HotSpot(TM) Client VM 22.1-b02 If I have string with size is more than 65534 bytes the file is marked as it has error, and when i start the program i receive the following error - "Error: Could not find or load main class..."; The project is Java Application Regards, Seslav
The Java string literal size has to be less than 0xFFFF. See: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.4.7
Can you add proper error message? Regards, Seslav Lazarov
The compiler message is: "constant string too long" See checkStringConstant(...) method in http://hg.openjdk.java.net/jdk7/tl/langtools/file/a72412b148d7/src/share/classes/com/sun/tools/javac/jvm/Gen.java and MAX_STRING_LENGTH in http://hg.openjdk.java.net/jdk7/tl/langtools/file/a72412b148d7/src/share/classes/com/sun/tools/javac/jvm/Pool.java
On the file in the project tree there is an error message that says: "Error parsing file"; The other message appears when I run the program here is quotation: "run: Error: Could not find or load main class .............. Java Result: 1 BUILD SUCCESSFUL (total time: 4 seconds)" There is no error message in the editor. Is it possible to put an error message in the editor?
The "Error parsing file" in the Project's View is a generic mark that the file contains 1 or more errors. The detailed list of these errors can be seen in Task List (Action Items). The "Could not find or load main class javaapplication4.JavaApplication4" probably can be changed by repair by throwing RuntimeException containing the "constant string too long" as it's in the Task List. Unfortunately editor cannot show the message, at least without performance penalty. The error is reported in generate phase of the compiler (assembling of class file) the editor ends in flow phase it does not try to generate the file. The "class" file is generated when you save the source file and it updates the Task List.
I saw the error in the Task List, I'm not using that feature very often that is why I didn't saw it earlier. I think would be good if you can change that error message (Could not find or load main class javaapplication4.JavaApplication4) because it does not tells you what the problem is or how to fix it or even on which line the problem is. Thanks for the information. Regards, Seslav.
>I think would be good if you can change that error message (Could not find or load main class javaapplication4.JavaApplication4) OK, filled as http://netbeans.org/bugzilla/show_bug.cgi?id=213359