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

Eclipse sees scala source as java

6 replies
Bram Bouwens
Joined: 2009-05-20,
User offline. Last seen 42 years 45 weeks ago.

I just did a fresh install of eclipse 3.4.2 (eclipse-SDK-3.4.2-linux-gtk-x86_64.tar.gz)
on Linux (Fedora 10).

Then I installed the Scala plugin as described in http://www.scala-lang.org/node/94
and tried the little Test Example there.

Now the problem is that the program is compiled as if it's plain old java, see
http://www.xs4all.nl/~bbouwens/scala_hello.png

I've been doing Java in eclipse for years, but I'm really not a wizard, and I'm new
to Scala. So I wonder, what could I be doing wrong?

Regards,

Bram

Bram Bouwens
Joined: 2009-05-20,
User offline. Last seen 42 years 45 weeks ago.
Re: Eclipse sees scala source as java

Sorry to reply to my own message, but I think I found the cause:
installation of the Scala plugin requires write access to the
eclipse package. When I fixed that an reinstalled the plugin, it worked.

I would recommend adding a comment in this sense to the instructions.

Bram

BillyPilgrim
Joined: 2009-05-24,
User offline. Last seen 2 years 49 weeks ago.
Re: Eclipse sees scala source as java

I had the same problem on Fedora 10.

I am using Fedora 10's version of Eclipse which is installed as an rpm
package. All I had to do was run Eclipse as root and install the scala
plugin as root then it was available to me under my user account and
functions properly. Other plugins have no problem being installed by a user
but the scala plugin won't install properly unless you so it as root.

milessabin
Joined: 2008-08-11,
User offline. Last seen 33 weeks 3 days ago.
Re: Eclipse sees scala source as java

On Sun, May 24, 2009 at 6:11 PM, BillyPilgrim wrote:
> I am using Fedora 10's version of Eclipse which is installed as an rpm
> package.  All I had to do was run Eclipse as root and install the scala
> plugin as root then it was available to me under my user account and
> functions properly.  Other plugins have no problem being installed by a user
> but the scala plugin won't install properly unless you so it as root.

Actually it's not necessary to install the Scala IDE as root, however,
due to an Eclipse limitation which will go away in 3.5 when it's
finally released there are a few hoops you have to jump through to
make it work.

You can find detailed instructions here,

http://wiki.eclipse.org/JDT_weaving_features

See the section headed "Installing JDT Weaving in a non-default location".

Cheers,

Miles

Antony Stubbs
Joined: 2009-07-10,
User offline. Last seen 1 year 2 hours ago.
Re: Eclipse sees scala source as java

I seem to have the same problem on OSX. Installing as root didn't help. I'm
running Eclipse 3.5.

I also see the same problem as this
http://lampsvn.epfl.ch/trac/scala/ticket/2090

I will try the nightly...

Miles Sabin wrote:
>
> On Sun, May 24, 2009 at 6:11 PM, BillyPilgrim
> wrote:
>> I am using Fedora 10's version of Eclipse which is installed as an rpm
>> package.  All I had to do was run Eclipse as root and install the scala
>> plugin as root then it was available to me under my user account and
>> functions properly.  Other plugins have no problem being installed by a
>> user
>> but the scala plugin won't install properly unless you so it as root.
>
> Actually it's not necessary to install the Scala IDE as root, however,
> due to an Eclipse limitation which will go away in 3.5 when it's
> finally released there are a few hoops you have to jump through to
> make it work.
>
> You can find detailed instructions here,
>
> http://wiki.eclipse.org/JDT_weaving_features
>
> See the section headed "Installing JDT Weaving in a non-default location".
>
> Cheers,
>
>
> Miles
>

Antony Stubbs
Joined: 2009-07-10,
User offline. Last seen 1 year 2 hours ago.
Re: Eclipse sees scala source as java

Same thing with
Eclipse Weaving Service Feature 1.6.4.20090313172428
org.eclipse.contribution.weaving.feature.group
Scala Eclipse Plugin 2.8.0.r18245-b20090710023859
ch.epfl.lamp.sdt.feature.group

i.e. the
object HiWorld extends Application {
Console.println("Hello World!")
}

gives:
Description Resource Path Location Type
Syntax error on token "object", interface expected HiWorld.scala /test2/src
line 1 Java Problem
etc...

Antony Stubbs wrote:
>
> I seem to have the same problem on OSX. Installing as root didn't help.
> I'm running Eclipse 3.5.
>
> I also see the same problem as this
> http://lampsvn.epfl.ch/trac/scala/ticket/2090
>
> I will try the nightly...
>
>
>
> Miles Sabin wrote:
>>
>> On Sun, May 24, 2009 at 6:11 PM, BillyPilgrim
>> wrote:
>>> I am using Fedora 10's version of Eclipse which is installed as an rpm
>>> package.  All I had to do was run Eclipse as root and install the scala
>>> plugin as root then it was available to me under my user account and
>>> functions properly.  Other plugins have no problem being installed by a
>>> user
>>> but the scala plugin won't install properly unless you so it as root.
>>
>> Actually it's not necessary to install the Scala IDE as root, however,
>> due to an Eclipse limitation which will go away in 3.5 when it's
>> finally released there are a few hoops you have to jump through to
>> make it work.
>>
>> You can find detailed instructions here,
>>
>> http://wiki.eclipse.org/JDT_weaving_features
>>
>> See the section headed "Installing JDT Weaving in a non-default
>> location".
>>
>> Cheers,
>>
>>
>> Miles
>>

milessabin
Joined: 2008-08-11,
User offline. Last seen 33 weeks 3 days ago.
Re: Eclipse sees scala source as java

This is definitely due to JDT Weaving not being enabled for you
installation ... see the other thread.

Cheers,

Miles

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