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.

Bug 250700

Summary: An exception has occurred in the compiler (1.8.0_20).
Product: java Reporter: ShakirAli
Component: CompilerAssignee: Dusan Balek <dbalek>
Status: RESOLVED FIXED    
Severity: normal CC: tzezula
Priority: P1    
Version: 8.0   
Hardware: All   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: this is the actual error of NetBeans IDE
this is the occurred error.
Verbos cleans and build error

Description ShakirAli 2015-02-25 16:42:01 UTC
Created attachment 152219 [details]
this is the actual error of NetBeans IDE

I develop a project in java using NetBeans 8.0. It have more than 3000 thousand source files. My project is running perfectly but when i want to Clean and Build the project it displays the attached error. Please help me out it is a big hurdle in the completion of my project. 
Thanks in advance.
Comment 1 Dusan Balek 2015-02-25 17:21:23 UTC
Could you please build your project with '-verbose' and attach the extended output to the issue? Thanks.
Comment 2 ShakirAli 2015-02-26 04:03:09 UTC
Thanks for response,
Could you please guide me about how to build the project using '-verbose'? I just click on Clean and Build the project using NetBeans.
Thanks.
Comment 3 Dusan Balek 2015-02-26 08:54:09 UTC
One of the possibilities is to click on the 'Re-run with Defferent Peremeters' button that can be found in the upper-left corner of your build Output Window and change Verbosity level to "Verbose". Another possibility is to change the "Tools->Options->Java->Ant->Verbosity Level" setting.
Comment 4 ShakirAli 2015-02-26 17:16:37 UTC
Created attachment 152262 [details]
this is the occurred error.

I compiled the project using verbose. Now it displays the attached ugly error.
Please help me. 
Thanks
Comment 5 ShakirAli 2015-02-26 17:48:19 UTC
Comment on attachment 152262 [details]
this is the occurred error.

The attached error only appears when i want to clean and build the project. It runs perfectly.
Comment 6 Dusan Balek 2015-02-27 08:03:46 UTC
To prevent OutOfMemoryErrors, try to increase the default heap size given to ant compilation (e.g. export ANT_OPTS=-Xmx1024m). Anyway, could you please attach the whole verbose output to this issue? To resolve the original error, we need to see the actual arguments passed to javac comoiler when building your project. Thanks.
Comment 7 ShakirAli 2015-02-27 08:49:51 UTC
Created attachment 152268 [details]
Verbos cleans and build error

first of all thanks a lot for giving me your time GOD bless you.
the attached file is the whole error (verbose output) which is occur during Clean and Build the project.
Regards,
Comment 8 Jiri Prox 2015-02-27 15:54:54 UTC
*** Bug 250770 has been marked as a duplicate of this bug. ***
Comment 9 Tomas Zezula 2015-02-27 16:24:12 UTC
Please can you try to put the following property into nbproject/project.properties file:

javac.fork=true

This property will force the Ant to fork javac compilation to separate VM. It's slower however it does not take the Ant memory.
If it does not help you will need to add:

memorymaximumsize="256m" 

attribute into javac task.
Comment 10 ShakirAli 2015-02-27 19:03:16 UTC
Dear Sir, I have added the javac.fork=true in nbproject/project.properties
but it is still giving me that error. Could you please tell me that where and how i can add memorymaximumsize="256m" attribute into javac task as you said?
Regards,
Comment 11 Tomas Zezula 2015-02-27 19:12:57 UTC
Try to add the -J-Xmx1G into Project Properties/Build/Compiling/Additional Compiler Options.
The value is stored into javac.compilerargs property in project.properties, so the same can be achieved by putting

javac.compilerargs=-J-Xmx1G

into project.properties.

If it does not work please attach me Ant debug log of such a run.
Thanks
Comment 12 ShakirAli 2015-02-28 07:41:05 UTC
Dear Sir,
With the help of this -J-Xmx1G you save my life, my 5 months and my money. I have successfully Clean and Build the project. But it gives me this error 
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Is this dangerous? Please guide me. I will remember you in my prayers. GOD bless you.
Thanks
Comment 13 Tomas Zezula 2015-02-28 17:47:13 UTC
The -Xlint:unchecked is a compiler warning that the code uses patterns which are not save regarding generic types and compiler cannot verify correctness.
It's mostly cast to generic type, raw types like List l = new ArrayList() (no type parameters) and assignments among generic type and raw types.

If you add -Xlint:unchecked into Project Properties/Build/Compiling/Additional Compiler Options the compiler will print warning on lines where there are problems with generics.
Comment 14 ShakirAli 2015-03-01 14:44:10 UTC
Thank a lot.
Comment 15 Tomas Zezula 2015-03-04 18:28:48 UTC
Fixed jet-main 5587c3d88969
Comment 16 Tomas Zezula 2015-03-04 18:31:16 UTC
It's impossible to prevent OutOfMemoryError when compiler runs in the same VM.
However I at least make it simpler to switch the compiler to external VM.
I've added a check box "Run Compilation in External VM" into Project Properties/Build/Compilation.
I also set the compilation in external VM as default for newly created j2se ant projects.
Comment 17 Quality Engineering 2015-03-06 04:11:47 UTC
Integrated into 'main-silver', will be available in build *201503060001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/5587c3d88969
User: Tomas Zezula <tzezula@netbeans.org>
Log: #250700:An exception has occurred in the compiler (1.8.0_20).