tor sorensen created NETBEANS-1280:
--------------------------------------

             Summary: Java/Groovy mixed project Java import error
                 Key: NETBEANS-1280
                 URL: https://issues.apache.org/jira/browse/NETBEANS-1280
             Project: NetBeans
          Issue Type: Bug
    Affects Versions: 9.0
         Environment: Fedora Linux 28 64bit
Linux Kernel 4.18.7
Mate 1.20.3
Memory: 8GiB
Processor: Intel Core i5-6200U 2.30GHzx4 
            Reporter: tor sorensen
         Attachments: buildGradleShot.png, groovyClassWithSimpleMethod.png, 
javaClassWithError.png, projectStructure.png

When I have a mixed Groovy/Java project in netbeans, my Java classes are unable 
to import groovy classes in the same project. It shows them as errors in the 
import list. But when I run the build everything compiles and the code works.

steps to reproduce:
 # Create a single gradle project.
 # Update build.gradle by adding `apply plugin: 'groovy'`
 # Update build.gradle adding `compile 
'org.codehaus.groovy:groovy:3.0.0-alpha-3'`
 # Run clean/build
 # Create `groovy` folder in the src/main/ directory
 # Move Main java class into src/main/groovy (this way the groovy plugin will 
compile and run everything together without problem.)
 # reload project so groovy shows up in the Projects view.
 # Create a groovy class next to the Main java class.
 # Create a simple method in groovy class.
 # in the java class, instantiate the groovy class and run the method from it.

At this point the Java class file will display the error `Cannot find symbol`. 
But if one runs the program it will compile and work just fine.

The intended functionality works in other IDE, including NetBeans 8.2, however 
in 9 there is this problem.

 

The attachments display the build.gradle file, the groovy and java class (java 
contains the errors) and a shot of the project structure.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to