Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is odd behaviour indeed. I created a new project in Netbeans (7.0.1) and added your code to it in a <code>genIntro.java</code> file. Some observations:</p> <ol> <li>The IDE does highlight the syntax error in your code</li> <li>Selecting Run the first time prompts the user that an error exists. You can choose to ignore this permanently, which I did.</li> <li><strong>If you choose to ignore the syntax error the project appears to build and Run successfully</strong></li> <li>In the bin folder for the project you can actually find a generated class file for the erroneous source. Reverse compiling this class shows that the syntax error <strong>has been removed</strong>.</li> <li>Back in the IDE, performing a Clean and Build (as opposed to a Run) generates the expected error:</li> </ol> <pre> Compiling 2 source files to /Users/tuoyo/Work/Data/Netbeans/Misc/build/classes /Users/tuoyo/Work/Data/Netbeans/Misc/src/misc/genIntro.java:14: '{' expected class genTest(){ 1 error /Users/tuoyo/Work/Data/Netbeans/Misc/nbproject/build-impl.xml:603: The following error occurred while executing this line: /Users/tuoyo/Work/Data/Netbeans/Misc/nbproject/build-impl.xml:245: Compile failed; see the compiler error output for details. BUILD FAILED (total time: 0 seconds) </pre> <p>Since Clean and Build invokes an Ant script behind the scenes I assume it is using the system JDK in console mode, which would jive with your original observations. Left unanswered is the question of how NetBeans is compiling the code when Run is selected - it does appear to be a different execution path.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload