My web project includes Groovy class files.
How should I compile it for my project using Eclipse?
Rest of my team is using IntelliIDEA to use it but I want to set it up in Eclipse.
To start with I have installed a Groovy Plug-In for my Eclipse and installed Groovy on my Windows.
You should be able to right click on the project -> Configure -> Convert to Groovy project.
If your project is a maven project, then you should also install m2eclipse as well as the optional m2eclipse configurator for groovy-eclipse. This will automatically configure your project for Eclipse and groovy.
Hope this links helps you. It has step by step on how to import your existing Groovy Project into eclipse so you can work on it.
http://docs.codehaus.org/display/GROOVY/Create+Your+First+Groovy+Project
If the project is created using grails create project, I believe all of the .project and .setting files are there for eclipse.
If you have the groovy eclipse plugin installed you should be able to mix your groovy classes into the same packages as your java code. Are you using maven or ant to build your actual war file? If not you will have to make sure that you compile the groovy classes along with the java code. while in eclipse you will be fine. Both ant and maven have facilities for compiling the groovy and java code together for your actual war that you deploy.
Related
Just started working with EJB (already developed project).
Imported the project from git and converted it to Maven project. However the project looks like a normal folder structure unlike regular java project. I cannot have any eclipse Java capabilities in side those files. Though they are Java files they look like class files to me with different symbol (can see that in image).
It won't compile unless I do maven build. Eclipse not showing any errors for those files even there are compile errors.
Running each time maven kills time and its irritating too.
Any help will be greatly appreciated. How to make that a normal Java project with eclipse compiler capabilities.
What configuration I have to do achieve this ?
Try running the command mvn eclipse:eclipse from the root folder of the project. It will create eclipse configuration files after which the project can be imported in Eclipse.
I'm developing an java application. I'm using eclipse Luna and Gradle as my build-system. I can define dependencies in my build script and they get downloaded on a build. That's no problem... But how can I tell eclipse, that it should automatically download and add the dependency to my build path?
I wan't to use auto completion and so on, without manually downloading an jar and copy it to the project.
Is it possible?
Regards
Marc
You need the Eclipse Gradle tooling, which adds lots of Gradle-related functionality. Most importantly, it manages your Eclipse project build path to match the build.gradle dependencies.
I have a project in java on netbeans 7.3 that I need to add more classes to. However, I am working with scala on eclipse. How can I import those classes from my eclipse project and execute them when I run the program on netbeans?
Not sure since I've never really configured stuff - just coded in prepared environments :(
If you are developing a library in your Scala application, i would suggest to use sbt and package the library as a jar and import that jar to your java project.
You will have to define a build file in sbt. I am not sure whether you already defined it and use the sbt package command.
sbt package
Try using sbt
I have an existing java project in Netbeans. I would like to start coding parts of it in Scala. I can add ".scala" files to the project but apparently they aren't compiled.
Can I somehow modify the existing Netbeans project settings in order to build java and scala sources together or do I need to create a new project and import the existing (java) sources?
Thanks
Martin
EDIT Sorry, I forgot to mention: I've installed the Scala-Plugin for netbeans, so compiling scala code is feasible.
I can create a new (Scala) project and add both scala and java sources to it and it compiles perfectly. My question was if (and how) it's possible to migrate an existing "java-only" project towards such a "mixed" project.
I don't think this is possible in the way you want it. You could however write an Ant build-script and let Netbeans execute it when building you application.
Otherwise I suggest to just create a new scala project and import it as *.jar library into your Java application. This keeps your project clean and nicely modularized.
You will need to migrate to use something like Maven to do this for you, as Netbeans doesn't know how to compile Scala code. Maven can be configured to compile the .scala files first then the .java, resulting in your final compiled source.
Have a look here for the maven config.
I would recommend doing a new maven project, Project form Archetype, and use the following.
http://mvnrepository.com/artifact/org.scala-tools.archetypes/scala-archetype-simple/1.3
This basically auto imports you a project all set up to get started running scala in a Java project.
I have developed an RCP plug-in (not standalone), and a Java Project with library code that the plug-in needs to call.
I have configured the Java Project in the same workspace. The plug-in has a project dependency on the Java Project.
The code compiles (the plug-in does some stuff with the Java Project / library code).
When I run the plug-in, I get a ClassNotFoundException:
java.lang.ClassNotFoundException: com.mycode.ArgSet
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:494)
Anyone know how to configure the plug-in properly?
Convert your library project to a plug-in project (right-click -> Configure -> Convert to Plug-in Project) and add it to the dependencies of your plug-in project (manifest editor, Dependencies tab).
You can also generate a JAR of your libray Project and add this jar to your plugin-project. That's the way we do it (but thats not that automatically, you have to export manualy every time you change the library-project.
The other bad with this jar-export is: when using another libraries (i.E. AXIS2 for Webservice,...) this Libraries must have also been added to the plugin project.