Using Groovy class in java project

36 views
Skip to first unread message

Craig

unread,
Jul 19, 2010, 7:20:18 PM7/19/10
to Utah Groovy & Grails User Group
I am trying out groovy and having some problems. I added the groovy
plugin to a java project in MyEclipse (which I'm not a big fan of, but
I'm stuck with it until I move the project to SpringSouce Tool Suite),
added groovy nature, and get syntax highlighting, etc. in the .groovy
file.

The groovy builder is called so I see a .class file for the groovy
class under bin-groovy. My problem is that when MyEclipse deploys, it
does not include the .class file for the groovy class in the
deployment. If I manually copy the .class file all is well, but that
is not an acceptable workaround.

Is there a specific source structure to follow when mixing groovy
classes in a java project? What project settings are needed to
indicate that the .class files in bin-groovy need to be included in a
deployment? My problem may be due to MyEclipse, but I would like some
general guidance about best practice strategies for including groovy
in a java project.

Eric Berry

unread,
Jul 20, 2010, 12:22:43 AM7/20/10
to ug...@googlegroups.com
I'm not sure how you would do that. Steve, you are familiar with
Eclipse and Groovy right? Do you know how to do this?

> --
> Utah Groovy & Grails Users Group
> ug...@googlegroups.com
> http://groups.google.com/group/uggug/
> - All meeting times and places can be found here.
>
> ** Please prefix your subject with "[JOB]" if your message is about job opportunities.
>

Steve Olsen

unread,
Jul 20, 2010, 12:04:08 PM7/20/10
to Utah Groovy & Grails User Group
Sorry -- I am familiar with Groovy, but not Eclipse. My IDEs of choice
are Netbeans and IntelliJ, but most of my Groovy is done either as
simple scripts, or in Grails. My only advice is to try switching to
STS and see what happens.

~Steve

On Jul 19, 10:22 pm, Eric Berry <cav...@gmail.com> wrote:
> I'm not sure how you would do that. Steve, you are familiar with
> Eclipse and Groovy right? Do you know how to do this?
>

Mark

unread,
Jul 20, 2010, 12:07:52 PM7/20/10
to ug...@googlegroups.com
Though I'm a huge fan of Eclipse, Netbeans in many was was easier to use for Grails development.

The best IDE i've used for Grails is without question Netbeans.  $300+ is a lot of money it seems, but if it's making your mortgage, it's a small price of admission to get a real increase in real-world development performance.  Get started with NetBeans and make sure that Grails is for you, and if you find that you really are enjoying it you might want to give the 30 day trail of Netbeans a try.

On that note, I can be very productive with Grails simply using a shell and a text editor such as JEdit or TextMate. Both are free/low cost. (I've been a textmate customer for many years, it's my favorite text and code editor).

Are you on Windows or using a Mac Steve?

Eric Berry

unread,
Jul 20, 2010, 12:08:55 PM7/20/10
to ug...@googlegroups.com
For me, I tried Netbeans and it doesn't even come close to the
productivity I have with IntelliJ Idea. I highly recommend that.

Steve Olsen

unread,
Jul 21, 2010, 12:06:44 PM7/21/10
to Utah Groovy & Grails User Group
I agree, IntelliJ is the best -- but it's not free, so I only use it
at work. At home for small or personal projects, I just use Notepad++
for the initial coding (how *cool* is that??!), and then Netbeans for
refactoring. (Actually, I start the project in Netbeans, then code in
Notepad++, then refactor in Netbeans but you get the basic idea...)

I tried STS a few months ago, and couldn't get it to find my Grails
install so I gave up. But I've been meaning to give it another go --
apparently it's getting pretty good now, from what I hear.

Getting back on topic for this thread now ;) . . . . Adding groovy to
a Java projects depends somewhat on your build tool. If you're using
maven, I'd point you to GMaven (http://docs.codehaus.org/display/
GMAVEN/Home) as a starting spot.

~Steve

On Jul 20, 10:08 am, Eric Berry <cav...@gmail.com> wrote:
> For me, I tried Netbeans and it doesn't even come close to the
> productivity I have with IntelliJ Idea.  I highly recommend that.
>
> On Tue, Jul 20, 2010 at 10:07 AM, Mark <mar...@gmail.com> wrote:
> > Though I'm a huge fan of Eclipse, Netbeans in many was was easier to use for
> > Grails development.
> > The best IDE i've used for Grails is without question Netbeans.  $300+ is a
> > lot of money it seems, but if it's making your mortgage, it's a small price
> > of admission to get a real increase in real-world development performance.
> >  Get started with NetBeans and make sure that Grails is for you, and if you
> > find that you really are enjoying it you might want to give the 30 day trail
> > of Netbeans a try.
> > On that note, I can be very productive with Grails simply using a shell and
> > a text editor such as JEdit or TextMate. Both are free/low cost. (I've been
> > a textmate customer for many years, it's my favorite text and code editor).
> > Are you on Windows or using a Mac Steve?
>
> > On Tue, Jul 20, 2010 at 10:04 AM, Steve Olsen <steven.ol...@gmail.com>
Reply all
Reply to author
Forward
0 new messages