This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Experiences with building & running the Scala Eclipse plugin (part 1)

10 replies
Ben Hutchison
Joined: 2009-01-21,
User offline. Last seen 42 years 45 weeks ago.

In the days Ive I followed the instruction for building the Scala
Eclipse plugin at
[https://lampsvn.epfl.ch/trac/scala/wiki/EclipsePlugin]. The last time I
did it was with Scala 2.7.2 about 6 months ago.

Overall, the instruction seemed to have improved and were pretty precise
and clear. Despite this, the overall process is lengthy and challenging.
I kept notes of things that went wrong
(a) to help others who have the same problems
(b) as feedback to improve the instructions in future

1. Section: Configuring Eclipse: "...or add the following to end of the
config.ini that Eclipse launches with..."

For me at least (WinVista), the file to modify is named Eclipse.ini, not
config.ini. There's a config.ini file under eclipse/configuration/ that
didn't seem to be the correct file.

2. Section: "Checking Out"

I made a stupid little mistake that wasted 30 mins. I did a Save Link As
on "plugin-projects.psf

" at bottom of page, but that link actually leads to a HTML page that
itself links to the raw file. The Import of the HTML failed with a
cryptic NPE from within Eclipse, that sent me on a wild goose chase.
Could this be improved?

3. "devel.prep" Build Fails

[scalacfork] Caused by: java.io.IOException: Cannot run program
"C:\Program Files\Java\jdk1.6.0_06\jre\bin\java.exe" (in directory
"C:\Users\ben\arcadia\Development\eclipse_workspace\scala"):
CreateProcess error=87, The parameter is incorrect

The same call failed from command line, due to spaces in "Program
Files", so I re-installed Java to a location without spaces and retried
but to no avail. Thn I noticed a previous user report
[http://www.nabble.com/-scala-tools--Cannot-Build-Scala-Eclipse-Plugin-on-Windows-Vista-x64-p21393410.html]
matched my problem, cased by the 32K char limit on windows cmd lines.

I followed workaround of moving scala projects to a directory with a
short path name (c:\scala), and this resolved the issue. Please put a
warning about this into the instructions - its tripped at least Brett &
I up so far.

4. "devel.prep" Build Runs out of memory

The next try ran out of memory about 10 mins into the build. -Xmx512M
worked "Build Complete", but perhaps suggest this by default, to prevent
time wasted on a rebuild.

5. First launch of the Run Configuration: Iimmediately failed "Cannot
start Java VM. Unable to reserve heap space." Reducing the -Xmx2048
setting to 1024M cleared this. Perhaps its a Windows OS limitation,
cannot allocate more than approx 3-4GB of potentially used address
space? Suggest maybe reducing both Eclipse -Xmx settings to 1-1.5G on
32-bit machines?

Subsequently, the setup of config.ini was intricate but seemed to go ok.
When the plugin launches, I see alot of console output indicating that
the weaver is active.

However, its not working - when I startup and attempt Create Scala
Application, it generates 73Kb of stack trace logs ! Im going to detail
this is a follow-up message, since that is more of an unresolved request
for help.

All in all, it took about 4.5 hours work from scratch to first launching
the plugin from within Eclipse with correct config.ini file. Thats a
barrier to casual contributors that it would be nice to lessen.

-Ben

Ben Hutchison
Joined: 2009-01-21,
User offline. Last seen 42 years 45 weeks ago.
Experiences with building & running the Scala Eclipse plugin (pa

Ben Hutchison wrote:
> However, its not working - when I startup and attempt Create Scala
> Application, it generates 73Kb of stack trace logs ! Im going to
> detail this is a follow-up message, since that is more of an
> unresolved request for help.
This story has a happy ending :)

Im pleased to report that the launch of the Scala plugin, built from
trunk source, from within Eclipse now seems to working correctly for me.
Doing a full clean and rebuild of all Scala projects from within Eclipse
resolved the errors I was getting earlier.

Ive also tried debugging the executing plugin from within Eclipse -
breakpoints, step through, variables watches, it all worked, I couldn't
find any problems there either. Satisfactory performance too.

The plugin really seems to be alot more stable and reliable than my
earlier experiences on 2.7.2. and 2.7.3 had led me to believe. Perhaps
all that bug fixing Ismael pointed out
[https://lampsvn.epfl.ch/trac/scala/query?status=closed&component=Eclipse+plugin&order=changetime&col=id&col=summary&col=type&col=changetime&owner=milessabin&desc=1]
has made the difference...

It leaves me feeling optimistic about the future of Scala tooling in
Eclipse.

-Ben

milessabin
Joined: 2008-08-11,
User offline. Last seen 33 weeks 3 days ago.
Re: Experiences with building & running the Scala Eclipse plug

On Fri, Feb 20, 2009 at 6:21 AM, Ben Hutchison wrote:
> The plugin really seems to be alot more stable and reliable than my earlier
> experiences on 2.7.2. and 2.7.3 had led me to believe. Perhaps all that bug
> fixing Ismael pointed out
> [https://lampsvn.epfl.ch/trac/scala/query?status=closed&component=Eclipse+plugin&order=changetime&col=id&col=summary&col=type&col=changetime&owner=milessabin&desc=1]
> has made the difference...

Actually the main gain in from the AspectJ underpinning.

Aside from dealing with a whole stack of issues more or less at a
stroke it's also made a *lot* easier to fix other bugs. Previously I
would find the (trivial) cause of a problem somewhere deep in the
bowels of the JDT and then have to spend weeks try to find someway to
trick the JDT into doing the right thing ... now we can just go right
in and change the JDTs behaviour directly :-)

> It leaves me feeling optimistic about the future of Scala tooling in

Thanks for the vote of confidence :-)

If you're building the plugin from SVN, the presumably you're gearing
up to contribute in some way? It'd be great to hear what you're
thinking of working on. Also could you edit the "Hacking the Eclipse
Plugin" Wiki page to fill in the gaps you pointed out in your earlier
mail?

Cheers,

Miles

Ismael Juma
Joined: 2009-01-07,
User offline. Last seen 42 years 45 weeks ago.
Re: Experiences with building & running the Scala Eclipse plugi

On Fri, 2009-02-20 at 15:13 +1100, Ben Hutchison wrote:
> 1. Section: Configuring Eclipse: "...or add the following to end of the
> config.ini that Eclipse launches with..."
>
> For me at least (WinVista), the file to modify is named Eclipse.ini, not
> config.ini. There's a config.ini file under eclipse/configuration/ that
> didn't seem to be the correct file.

Even though Eclipse.ini might also work, config.ini is cross-platform.
Maybe you looked for it in the wrong workspace? I had at first looked at
the runtime workspace, but the default location is under the workspace
that you're using to build the plugin.

> 2. Section: "Checking Out"
>
> I made a stupid little mistake that wasted 30 mins. I did a Save Link As
> on "plugin-projects.psf
>
> " at bottom of page, but that link actually leads to a HTML page that
> itself links to the raw file. The Import of the HTML failed with a
> cryptic NPE from within Eclipse, that sent me on a wild goose chase.
> Could this be improved?

Agreed, this should be improved, it also failed for me.

> 5. First launch of the Run Configuration: Iimmediately failed "Cannot
> start Java VM. Unable to reserve heap space." Reducing the -Xmx2048
> setting to 1024M cleared this. Perhaps its a Windows OS limitation,
> cannot allocate more than approx 3-4GB of potentially used address
> space? Suggest maybe reducing both Eclipse -Xmx settings to 1-1.5G on
> 32-bit machines?

Yes, that is a 32-bit Windows limitation. Well, the 4GB limitation is a
32-bit OS issue, but Windows is even more restrictive and that's why
even 2GB often doesn't work.

> Subsequently, the setup of config.ini was intricate but seemed to go ok.
> When the plugin launches, I see alot of console output indicating that
> the weaver is active.
>
> However, its not working - when I startup and attempt Create Scala
> Application, it generates 73Kb of stack trace logs ! Im going to detail
> this is a follow-up message, since that is more of an unresolved request
> for help.
>
> All in all, it took about 4.5 hours work from scratch to first launching
> the plugin from within Eclipse with correct config.ini file. Thats a
> barrier to casual contributors that it would be nice to lessen.

Miles didn't say it in his message, but as I understand it some of this
work will not be necessary with Eclipse 3.5. Miles, please correct me if
I am wrong.

Ismael

milessabin
Joined: 2008-08-11,
User offline. Last seen 33 weeks 3 days ago.
Re: Experiences with building & running the Scala Eclipse plug

On Fri, Feb 20, 2009 at 9:06 AM, Ismael Juma wrote:
> Miles didn't say it in his message, but as I understand it some of this
> work will not be necessary with Eclipse 3.5. Miles, please correct me if
> I am wrong.

It's dependent on this patch,

http://bugs.eclipse.org/bugs/show_bug.cgi?id=241477

which properly resolves this issue,

http://bugs.eclipse.org/bugs/show_bug.cgi?id=257178

being rolled into Eclipse 3.5.

Prospects are quite good, but it can be ... umm ... challenging to
persuade the Eclipse project to accept patches.

Cheers,

Miles

milessabin
Joined: 2008-08-11,
User offline. Last seen 33 weeks 3 days ago.
Re: Experiences with building & running the Scala Eclipse plug

On Fri, Feb 20, 2009 at 9:06 AM, Ismael Juma wrote:
>> 5. First launch of the Run Configuration: Iimmediately failed "Cannot
>> start Java VM. Unable to reserve heap space." Reducing the -Xmx2048
>> setting to 1024M cleared this. Perhaps its a Windows OS limitation,
>> cannot allocate more than approx 3-4GB of potentially used address
>> space? Suggest maybe reducing both Eclipse -Xmx settings to 1-1.5G on
>> 32-bit machines?
>
> Yes, that is a 32-bit Windows limitation. Well, the 4GB limitation is a
> 32-bit OS issue, but Windows is even more restrictive and that's why
> even 2GB often doesn't work.

My bad ... 2GB is fine for 32 bit Linux.

Cheers,

Miles

Mohamed Bana
Joined: 2008-12-20,
User offline. Last seen 3 years 19 weeks ago.
Re: Experiences with building & running the Scala Eclipse plugin

you probably already know this, but you don't really have to build the
scala and scala-library projects just close the two and it'll use the
libraries from the nightly.

thanks to Josh Suereth for pointing this out.

Ben Hutchison wrote:
> Ben Hutchison wrote:
>> However, its not working - when I startup and attempt Create Scala
>> Application, it generates 73Kb of stack trace logs ! Im going to
>> detail this is a follow-up message, since that is more of an
>> unresolved request for help.
> This story has a happy ending :)
>
> Im pleased to report that the launch of the Scala plugin, built from
> trunk source, from within Eclipse now seems to working correctly for me.
> Doing a full clean and rebuild of all Scala projects from within Eclipse
> resolved the errors I was getting earlier.
>
> Ive also tried debugging the executing plugin from within Eclipse -
> breakpoints, step through, variables watches, it all worked, I couldn't
> find any problems there either. Satisfactory performance too.
>
> The plugin really seems to be alot more stable and reliable than my
> earlier experiences on 2.7.2. and 2.7.3 had led me to believe. Perhaps
> all that bug fixing Ismael pointed out
> [https://lampsvn.epfl.ch/trac/scala/query?status=closed&component=Eclipse+plugin&order=changetime&col=id&col=summary&col=type&col=changetime&owner=milessabin&desc=1]
> has made the difference...
>
> It leaves me feeling optimistic about the future of Scala tooling in
> Eclipse.
>
> -Ben
>

milessabin
Joined: 2008-08-11,
User offline. Last seen 33 weeks 3 days ago.
Re: Re: Experiences with building & running the Scala Eclipse

On Sat, Feb 21, 2009 at 12:06 AM, Mohamed Bana
wrote:
> you probably already know this, but you don't really have to build the scala
> and scala-library projects just close the two and it'll use the libraries
> from the nightly.
>
> thanks to Josh Suereth for pointing this out.

Would be great if someone updated the Wiki page to include this (hint, hint ;-)

Cheers,

Miles

Joshua.Suereth
Joined: 2008-09-02,
User offline. Last seen 32 weeks 5 days ago.
Re: Re: Experiences with building & running the Scala Eclipse
I believe I did in the FAQ.  Would you like it on the "hacking the plugin" section?

On Fri, Feb 20, 2009 at 7:56 PM, Miles Sabin <miles@milessabin.com> wrote:
On Sat, Feb 21, 2009 at 12:06 AM, Mohamed Bana
<mbana.lists@googlemail.com> wrote:
> you probably already know this, but you don't really have to build the scala
> and scala-library projects just close the two and it'll use the libraries
> from the nightly.
>
> thanks to Josh Suereth for pointing this out.

Would be great if someone updated the Wiki page to include this (hint, hint ;-)

Cheers,


Miles

--
Miles Sabin
tel:    +44 (0)1273 720 779
mobile: +44 (0)7813 944 528
skype:  milessabin

milessabin
Joined: 2008-08-11,
User offline. Last seen 33 weeks 3 days ago.
Re: Re: Experiences with building & running the Scala Eclipse

On Sat, Feb 21, 2009 at 12:59 AM, Josh Suereth wrote:
> I believe I did in the FAQ. Would you like it on the "hacking the plugin"
> section?

Given that this is mainly a "Hacking the plugin" strategy that would
probably make sense, yes :-)

Cheers,

Miles

Joshua.Suereth
Joined: 2008-09-02,
User offline. Last seen 32 weeks 5 days ago.
Re: Re: Experiences with building & running the Scala Eclipse
DONE!

Also three things:

1) We should make the FAQ  more visibile (I couldn't find a link, and the google hit took me to nabble, which had the link), as I tend to prefer reading FAQs before deciding to contribute, or when running into issues (perhaps others do as well?).

2) I believe you can start crossing things off of the wish list! :)

3)  I added a "how to use git for concurrent patch/feature development on the plugin" section.   This is basically the brain-dump Paul Phillips gave me on #scala.  Hopefully it will help/encourage other hackers!

4) I'm unable to do simple arithmetic

-Josh


On Fri, Feb 20, 2009 at 8:11 PM, Miles Sabin <miles@milessabin.com> wrote:
On Sat, Feb 21, 2009 at 12:59 AM, Josh Suereth <joshua.suereth@gmail.com> wrote:
> I believe I did in the FAQ.  Would you like it on the "hacking the plugin"
> section?

Given that this is mainly a "Hacking the plugin" strategy that would
probably make sense, yes :-)

Cheers,


Miles

--
Miles Sabin
tel:    +44 (0)1273 720 779
mobile: +44 (0)7813 944 528
skype:  milessabin

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland