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.
I created a new project "abc" which uses the Java Platform "JDK 1.5 (Default)" for which I have set the "Additional Compiler Options" to "-J-Xmx1024m" and I get the message below when I try to compile. Created dir: C:\Dokumente und Einstellungen\holger\abc\build\classes Compiling 1 source file to C:\Dokumente und Einstellungen\holger\abc\build\classes javac: invalid flag: -J-Xmx1024m Usage: javac <options> <source files> where possible options include: -g Generate all debugging info -g:none Generate no debugging info -g:{lines,vars,source} Generate only some debugging info -nowarn Generate no warnings -verbose Output messages about what the compiler is doing -deprecation Output source locations where deprecated APIs are used -classpath <path> Specify where to find user class files -cp <path> Specify where to find user class files -sourcepath <path> Specify where to find input source files -bootclasspath <path> Override location of bootstrap class files -extdirs <dirs> Override location of installed extensions -endorseddirs <dirs> Override location of endorsed standards path -d <directory> Specify where to place generated class files -encoding <encoding> Specify character encoding used by source files -source <release> Provide source compatibility with specified release -target <release> Generate class files for specific VM version -version Version information -help Print a synopsis of standard options -X Print a synopsis of nonstandard options -J<flag> Pass <flag> directly to the runtime system BUILD FAILED (total time: 0 seconds) Now I created a new Java Platform "Java HotSpot(TM) Client VM 1.5.0_05-b05" (which is actually the same as the default one) and set the the project Java Platform to this one. Now I start the compile action and the compilation works fine.
I don't think it's defect at all, because javac is executed in the same JVM as IDE is running on and it's not possible to pass "-J" arguments to the process. If the javac is executed in non-default JVM it's different case becasue such process is started for each Ant script execution and so it's possible to pass any args you want.
This is not a bug, it is documented behavior of the default platform. The default platform does not fork the javac or java (it is the default way how Ant works), this is much more faster, but you cannot pass the -X options to it, it runs in the IDEs heap. If we change it users will complain about it. The project customizer should warn user about it, there is a issue about adding the warning into the project's customizer: http://www.netbeans.org/issues/show_bug.cgi?id=66043 Closing this issue as a duplicate of the bug. *** This issue has been marked as a duplicate of 66043 ***