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.
Created attachment 137786 [details] IDE log Please try: - create Java Application, all default - create a new Groovy class "Foo" in the default existing package - in JavaApplication.java, paste this into main() method Foo f = new Foo(); - run JavaApplication.java file => run fails with following output (running project is OK): ant -f /home/vriha/NetBeansProjects/a/JavaApplication -Djavac.includes=javaapplication/JavaApplication.java -Drun.class=javaapplication.JavaApplication -Dnb.internal.action.name=run.single run-single init: deps-jar: Created dir: /home/vriha/NetBeansProjects/a/JavaApplication/build Updating property file: /home/vriha/NetBeansProjects/a/JavaApplication/build/built-jar.properties Created dir: /home/vriha/NetBeansProjects/a/JavaApplication/build/classes Created dir: /home/vriha/NetBeansProjects/a/JavaApplication/build/empty Compiling 1 source file to /home/vriha/NetBeansProjects/a/JavaApplication/build/classes org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Compile error during compilation with javac. /ho me/vriha/NetBeansProjects/a/JavaApplication/src/javaapplication/JavaApplication.java:18: error: cannot find symbol Foo f = new Foo(); ^ symbol: class Foo location: class JavaApplication /home/vriha/NetBeansProjects/a/JavaApplication/s rc/javaapplication/JavaApplication.java:18: error: cannot find symbol Foo f = new Foo(); ^ symbol: class Foo location: class JavaApplication 2 errors 1 error /home/vriha/NetBeansProjects/a/JavaApplication/nbproject/build-impl.xml:944: The following error occurred while executing this line: /home/vriha/NetBeansProjects/a/JavaApplication/nbproject/groovy-build.xml:26: Forked groovyc returned error code: 1 BUILD FAILED (total time: 2 seconds) Product Version: NetBeans IDE Dev (Build 201307242300) Java: 1.7.0_40-ea; Java HotSpot(TM) Client VM 24.0-b52 Runtime: Java(TM) SE Runtime Environment 1.7.0_40-ea-b33 System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
I think this is most probably the same problem as issue 233416 (at least I do not see any way how to evaluate-fix it on the Groovy side). Closing the issue as duplicate and if the problem persist after the 233416 fix, I'll take a look again.
*** This bug has been marked as a duplicate of bug 233416 ***
OK, I'll try it again once the issue will be fixed. Thank you for evaluation.
Martine, unfortunately it is still reproducible although the issue 233416 is fixed. Thank you Product Version: NetBeans IDE Dev (Build 201309020001) Java: 1.7.0_40; Java HotSpot(TM) Client VM 24.0-b55 Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b39 System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
Ok, thanks. I'll take a look at it..
*** Bug 234936 has been marked as a duplicate of this bug. ***
Created attachment 139581 [details] Patch with possible solution Patch of possible solution. I need to evaluate further if it's completely safe to make such change.
Well this is awesome, such thing obviously never worked (fails also in 7.3 where the Run File action were implemented for Groovy files) because the build script is including only the source file where the Run action is performed and thus groovy compiler cannot see the rest of the source directory. Same failure is there also when using two groovy files or also for two java files (with groovy activated within that project). On the other hand when running the whole project, the "includes" attribute contains "**" value and thus everything works as expected. Proposed solution just removes "includes" attribute from groovyc Ant task which should be safe and correct. Current usage of @{includes} attribute was just incorrect from the beginning. I'll push the changes soon.. Few related links: http://groovy.codehaus.org/The+groovyc+Ant+Task http://ant.apache.org/manual/Tasks/javac.html#srcdirnote
Fixed by change-set: web-main #d67b6a86adca
None one has the "clever" idea to run a single file as I did :) Thanks Martine. After offline discussion marking as HR_FIX_CAND so it gets into 7.4
Verified in trunk, please continue with integration to release74 as described in [1]. Thank you [1] http://wiki.netbeans.org/NetBeans_74_HighResistance Product Version: NetBeans IDE Dev (Build 201309040001) Java: 1.7.0_40; Java HotSpot(TM) Client VM 24.0-b55 Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b39 System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
Martine, may I ask you for review?
(In reply to Martin Janicek from comment #12) > Martine, may I ask you for review? The patch looks safe.
releases #a25ef81941bf
Verified in RC1 Product Version: NetBeans IDE 7.4 RC1 (Build 201309162201) Java: 1.7.0_40; Java HotSpot(TM) Client VM 24.0-b56 Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b43 System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)