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

Re: Eclipse plugin too buggy for my Hello World - Am I doing anything wrong?

8 replies
Naftoli Gugenheim
Joined: 2008-12-17,
User offline. Last seen 42 years 45 weeks ago.

Yes, it's in serious use. :)
Is your eclipse folder writeable (not necessary for 3.5) and is JDT weaving enabled?

-------------------------------------
Ricky Clarkson wrote:

No, it's not ready for serious use. Miles apparently is getting quite
close to getting it there. It is maintained, no worries on that
score. Watch this list for an update on usability.

The IDEA plugin seems more complete.

2009/7/12 Morten :
> I am new to Scala but decided to give it a try today and installed the
> newest 2.7.5final Eclipse Plugin for Eclipse 3.4 on my Mac OS X 10.5. Just
> in the first 2 minutes of testing I ran into two bugs - one of them fatal -
> which leads me to ask if this plugin is indeed ready for serious use or if I
> am doing anything wrong ?
>
> THE BUGS:
> After install+restart I created a new java projected, added scala nature and
> added a package "testpackage" with a new scala file ScalaTest.scala:
>
> package testpackage
> object ScalaTest {
>     def main(args: Array[String]) {
>       println("Hello, world!")
>     }
> }
>
> When I right click on the file and select "Run as scala application" I get
> this exception:
> Exception in thread "main" java.lang.NoClassDefFoundError:
> testpackage/ScalaTes
> Caused by: java.lang.ClassNotFoundException: testpackage.ScalaTes
>     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
>     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
>     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:402)
>
> Note that the class the plugin tries to run lacks a "t" at the end, so it
> seems to be a bug in the plugin (properly some sub-string operation going
> wrong). Apart from this fatal bug, I also notice that plugin copies *.scala
> files to the build directory which consequently contains a mix of source
> code and *.class files. Hence any generated jar files will incorrectly
> contain source files as well.
>
> So in conclusion, I have manged to run into one fatal bug and one minor bug
> in just 2 minutes for my first try of the plugin. How are the experience
> from other developers on this list ?
>
> P.S. No I did not report this as bug request. Generally, to do that I need
> to be convinced that the software is usable and maintained. I am willing to
> give the eclipse plugin the benefit of the doubt though which is why have
> written the msg.
>
>
> ________________________________
> Få en billig laptop. Se Kelkoos gode tilbud her!

Morten
Joined: 2009-07-12,
User offline. Last seen 42 years 45 weeks ago.
Re: Eclipse plugin too buggy for my Hello World - Am I doing a
Thanks for the replies.

Yes to both questions (eclipse folder IS writable and weaving is enabled).

On the other hand, I can not se what the relevance is ? The NoClassDefFoundError bug I get is clearly because the plugin forgets the last letter in the class name as I noted before. I.e. a logical bug !!

Also, I can't understand why anybody can use this plugin without being able to run code ?

--- Den søn 12/7/09 skrev Naftoli Gugenhem <naftoligug@gmail.com>:

Fra: Naftoli Gugenhem <naftoligug@gmail.com>
Emne: Re: [scala-tools] Eclipse plugin too buggy for my Hello World - Am I doing anything wrong?
Til: ricky.clarkson@gmail.com, mortench2004@yahoo.dk
Cc: scala-tools@listes.epfl.ch
Dato: søndag 12. juli 2009 21.17

Yes, it's in serious use. :)
Is your eclipse folder writeable (not necessary for 3.5) and is JDT weaving enabled?

-------------------------------------
Ricky Clarkson<ricky [dot] clarkson [at] gmail [dot] com" href="/mc/compose?to=ricky.clarkson@gmail.com" rel="nofollow">ricky.clarkson@gmail.com> wrote:

No, it's not ready for serious use.  Miles apparently is getting quite
close to getting it there.  It is maintained, no worries on that
score.  Watch this list for an update on usability.

The IDEA plugin seems more complete.

2009/7/12 Morten <mortench2004 [at] yahoo [dot] dk" href="/mc/compose?to=mortench2004@yahoo.dk" rel="nofollow">mortench2004@yahoo.dk>:
> I am new to Scala but decided to give it a try today and installed the
> newest 2.7.5final Eclipse Plugin for Eclipse 3.4 on my Mac OS X 10.5. Just
> in the first 2 minutes of testing I ran into two bugs - one of them fatal -
> which leads me to ask if this plugin is indeed ready for serious use or if I
> am doing anything wrong ?
>
> THE BUGS:
> After install+restart I created a new java projected, added scala nature and
> added a package "testpackage" with a new scala file ScalaTest.scala:
>
> package testpackage
> object ScalaTest {
>     def main(args: Array[String]) {
>       println("Hello, world!")
>     }
> }
>
> When I right click on the file and select "Run as scala application" I get
> this exception:
> Exception in thread "main" java.lang.NoClassDefFoundError:
> testpackage/ScalaTes
> Caused by: java.lang.ClassNotFoundException: testpackage.ScalaTes
>     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
>     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
>     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:402)
>
> Note that the class the plugin tries to run lacks a "t" at the end, so it
> seems to be a bug in the plugin (properly some sub-string operation going
> wrong). Apart from this fatal bug, I also notice that plugin copies *.scala
> files to the build directory which consequently contains a mix of source
> code and *.class files. Hence any generated jar files will incorrectly
> contain source files as well.
>
> So in conclusion, I have manged to run into one fatal bug and one minor bug
> in just 2 minutes for my first try of the plugin. How are the experience
> from other developers on this list ?
>
> P.S. No I did not report this as bug request. Generally, to do that I need
> to be convinced that the software is usable and maintained. I am willing to
> give the eclipse plugin the benefit of the doubt though which is why have
> written the msg.
>
>
> ________________________________
> Få en billig laptop. Se Kelkoos gode tilbud her!



--
Ricky Clarkson
Java Programmer, AD Holdings
+44 1565 770804
Skype: ricky_clarkson
Google Talk: ricky [dot] clarkson [at] gmail [dot] com" href="/mc/compose?to=ricky.clarkson@gmail.com" rel="nofollow">ricky.clarkson@gmail.com


Trænger du til at se det store billede? Kelkoo giver dig gode tilbud på LCD TV!
Naftoli Gugenheim
Joined: 2008-12-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Eclipse plugin too buggy for my Hello World - Am I doing a

Sorry, I didn't read your message closely enough. I certainly run scala code, though.
1) Can you run using Run as... ?
2) Re .scala files being copied, that happens sometimes, not sure when; could be when builder crashed. Any clues in Error Log view? Also, I usually run eclipsec, i.e., in a console, so I see all of the plugins output and what it's doing.

-------------------------------------
Morten wrote:

Thanks for the replies.

Yes to both questions (eclipse folder IS writable and weaving is enabled).

On the other hand, I can not se what the relevance is ? The NoClassDefFoundError bug I get is clearly because the plugin forgets the last letter in the class name as I noted before. I.e. a logical bug !!

Also, I can't understand why anybody can use this plugin without being able to run code ?

Morten
Joined: 2009-07-12,
User offline. Last seen 42 years 45 weeks ago.
Re: Eclipse plugin too buggy for my Hello World - Am I doing a
Yes, I was using "Run As". Since I am using Mac OS and the old v3.4.0 of eclipse normally, I just tried also on Windows using the brand new eclipse release and got the same error. So since I can reproduce the bug in multiple machines, and you are not getting this error, then I guess you are not using the newest Scala plugin ?

As for the log you ask about, on Windows I get a java.lang.Error in linie 284 of Plugin.scala with msg "no completed at 85" but I don't get the same log msg on my Mac so it might be something not related to my issue ?

--- Den søn 12/7/09 skrev Naftoli Gugenhem <naftoligug@gmail.com>:

Fra: Naftoli Gugenhem <naftoligug@gmail.com>
Emne: Re: [scala-tools] Eclipse plugin too buggy for my Hello World - Am I doing anything wrong?
Til: mortench2004@yahoo.dk, ricky.clarkson@gmail.com
Cc: scala-tools@listes.epfl.ch
Dato: søndag 12. juli 2009 21.52

Sorry, I didn't read your message closely enough. I certainly run scala code, though.
1) Can you run using Run as... ?
2) Re .scala files being copied, that happens sometimes, not sure when; could be when builder crashed. Any clues in Error Log view? Also, I usually run eclipsec, i.e., in a console, so I see all of the plugins output and what it's doing.


-------------------------------------
Morten<mortench2004 [at] yahoo [dot] dk" href="/mc/compose?to=mortench2004@yahoo.dk" rel="nofollow">mortench2004@yahoo.dk> wrote:

Thanks for the replies.

Yes to both questions (eclipse folder IS writable and weaving is enabled).

On the other hand, I can not se what the relevance is ? The NoClassDefFoundError bug I get is clearly because the plugin forgets the last letter in the class name as I noted before. I.e. a logical bug !!

Also, I can't understand why anybody can use this plugin without being able to run code ?

--- Den søn 12/7/09 skrev Naftoli Gugenhem <naftoligug [at] gmail [dot] com" href="/mc/compose?to=naftoligug@gmail.com" rel="nofollow">naftoligug@gmail.com>:

Fra: Naftoli Gugenhem <naftoligug [at] gmail [dot] com" href="/mc/compose?to=naftoligug@gmail.com" rel="nofollow">naftoligug@gmail.com>
Emne: Re: [scala-tools] Eclipse plugin too buggy for my Hello World - Am I  doing anything wrong?
Til: ricky [dot] clarkson [at] gmail [dot] com" href="/mc/compose?to=ricky.clarkson@gmail.com" rel="nofollow">ricky.clarkson@gmail.com, mortench2004 [at] yahoo [dot] dk" href="/mc/compose?to=mortench2004@yahoo.dk" rel="nofollow">mortench2004@yahoo.dk
Cc: scala-tools [at] listes [dot] epfl [dot] ch" href="/mc/compose?to=scala-tools@listes.epfl.ch" rel="nofollow">scala-tools@listes.epfl.ch
Dato: søndag 12. juli 2009 21.17

Yes, it's in serious use. :)
Is your eclipse folder writeable (not necessary for 3.5) and is JDT weaving enabled?

-------------------------------------
Ricky Clarkson<ricky [dot] clarkson [at] gmail [dot] com" href="/mc/compose?to=ricky.clarkson@gmail.com" rel="nofollow">ricky.clarkson@gmail.com> wrote:

No, it's not ready for serious use.  Miles apparently is getting quite
close to getting it there.  It is maintained, no worries on that
score.  Watch this list for an update on usability.

The IDEA plugin seems more complete.

2009/7/12 Morten <mortench2004 [at] yahoo [dot] dk" href="/mc/compose?to=mortench2004@yahoo.dk" rel="nofollow">mortench2004@yahoo.dk>:
> I am new to Scala but decided to give it a try today and installed the
> newest 2.7.5final Eclipse Plugin for Eclipse 3.4 on my Mac OS X 10.5. Just
> in the first 2 minutes of testing I ran into two bugs - one of them fatal -
> which leads me to ask if this plugin is indeed ready for serious use or if I
> am doing anything wrong ?
>
> THE BUGS:
> After install+restart I created a new java projected, added scala nature and
> added a package "testpackage" with a new scala file ScalaTest.scala:
>
> package testpackage
> object ScalaTest {
>     def main(args: Array[String]) {
>       println("Hello, world!")
>     }
> }
>
> When I right click on the file and select "Run as scala application" I get
> this exception:
> Exception in thread "main" java.lang.NoClassDefFoundError:
> testpackage/ScalaTes
> Caused by: java.lang.ClassNotFoundException: testpackage.ScalaTes
>     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
>     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
>     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:402)
>
> Note that the class the plugin tries to run lacks a "t" at the end, so it
> seems to be a bug in the plugin (properly some sub-string operation going
> wrong). Apart from this fatal bug, I also notice that plugin copies *.scala
> files to the build directory which consequently contains a mix of source
> code and *.class files. Hence any generated jar files will incorrectly
> contain source files as well.
>
> So in conclusion, I have manged to run into one fatal bug and one minor bug
> in just 2 minutes for my first try of the plugin. How are the experience
> from other developers on this list ?
>
> P.S. No I did not report this as bug request. Generally, to do that I need
> to be convinced that the software is usable and maintained. I am willing to
> give the eclipse plugin the benefit of the doubt though which is why have
> written the msg.
>
>
> ________________________________
> Få en billig laptop. Se Kelkoos gode tilbud her!



--
Ricky Clarkson
Java Programmer, AD Holdings
+44 1565 770804
Skype: ricky_clarkson
Google Talk: ricky [dot] clarkson [at] gmail [dot] com" href="/mc/compose?to=ricky.clarkson@gmail.com" rel="nofollow">ricky.clarkson@gmail.com



      Trænger du til at se det store billede? Kelkoo giver dig gode tilbud på LCD TV! Se her http://dk.yahoo.com/r/pat/lcd


Få en billig laptop. Se Kelkoos gode tilbud her!
Naftoli Gugenheim
Joined: 2008-12-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Eclipse plugin too buggy for my Hello World - Am I doing a

There is a menu command Run as scala application, or you can do Run as... which opens a dialog where you have fine-grained control over the launch. Are you saying that the name is specified properly there but it anyway launches wrong?
I used the same version as you. But why don't you try eclipse 3.5?

-------------------------------------
Morten wrote:

Yes, I was using "Run As". Since I am using Mac OS and the old v3.4.0 of eclipse normally, I just tried also on Windows using the brand new eclipse release and got the same error. So since I can reproduce the bug in multiple machines, and you are not getting this error, then I guess you are not using the newest Scala plugin ?

As for the log you ask about, on Windows I get a java.lang.Error in linie 284 of Plugin.scala with msg "no completed at 85" but I don't get the same log msg on my Mac so it might be something not related to my issue ?

Morten
Joined: 2009-07-12,
User offline. Last seen 42 years 45 weeks ago.
Re: Eclipse plugin too buggy for my Hello World - Am I doing a
Ok, I see what you mean.... A workaround is possible... When I just select "run as scala application" the problem occurs but if I select the menu below it I get a chance to add a "t" to the class name that the plugin incorrectly defaults to and I can run it :-)

Unfortunately, I now got an error saying "NoSuchMethodError: main" but since they is my first scala program maybe the code is wrong ? (in java main should be static but apparently not in scala ?)

package testpackage
object ScalaTest {
     def main(args: Array[String]) {
       println("Hello, world!")
     }
 }

--- Den søn 12/7/09 skrev Naftoli Gugenhem <naftoligug@gmail.com>:

Fra: Naftoli Gugenhem <naftoligug@gmail.com>
Emne: Re: [scala-tools] Eclipse plugin too buggy for my Hello World - Am I doing anything wrong?
Til: mortench2004@yahoo.dk, ricky.clarkson@gmail.com
Cc: scala-tools@listes.epfl.ch
Dato: søndag 12. juli 2009 22.32

There is a menu command Run as scala application, or you can do Run as... which opens a dialog where you have fine-grained control over the launch. Are you saying that the name is specified properly there but it anyway launches wrong?
I used the same version as you. But why don't you try eclipse 3.5?

-------------------------------------
Morten<mortench2004 [at] yahoo [dot] dk" href="/mc/compose?to=mortench2004@yahoo.dk" rel="nofollow">mortench2004@yahoo.dk> wrote:

Yes, I was using "Run As". Since I am using Mac OS and the old v3.4.0 of eclipse normally, I just tried also on Windows using the brand new eclipse release and got the same error. So since I can reproduce the bug in multiple machines, and you are not getting this error, then I guess you are not using the newest Scala plugin ?

As for the log you ask about, on Windows I get a java.lang.Error in linie 284 of Plugin.scala with msg "no completed at 85" but I don't get the same log msg on my Mac so it might be something not related to my issue ?

--- Den søn 12/7/09 skrev Naftoli Gugenhem <naftoligug [at] gmail [dot] com" href="/mc/compose?to=naftoligug@gmail.com" rel="nofollow">naftoligug@gmail.com>:

Fra: Naftoli Gugenhem <naftoligug [at] gmail [dot] com" href="/mc/compose?to=naftoligug@gmail.com" rel="nofollow">naftoligug@gmail.com>
Emne: Re: [scala-tools] Eclipse plugin too buggy for my Hello World - Am I  doing anything wrong?
Til: mortench2004 [at] yahoo [dot] dk" href="/mc/compose?to=mortench2004@yahoo.dk" rel="nofollow">mortench2004@yahoo.dk, ricky [dot] clarkson [at] gmail [dot] com" href="/mc/compose?to=ricky.clarkson@gmail.com" rel="nofollow">ricky.clarkson@gmail.com
Cc: scala-tools [at] listes [dot] epfl [dot] ch" href="/mc/compose?to=scala-tools@listes.epfl.ch" rel="nofollow">scala-tools@listes.epfl.ch
Dato: søndag 12. juli 2009 21.52

Sorry, I didn't read your message closely enough. I certainly run scala code, though.
1) Can you run using Run as... ?
2) Re .scala files being copied, that happens sometimes, not sure when; could be when builder crashed. Any clues in Error Log view? Also, I usually run eclipsec, i.e., in a console, so I see all of the plugins output and what it's doing.


-------------------------------------
Morten<mortench2004 [at] yahoo [dot] dk" href="/mc/compose?to=mortench2004@yahoo.dk" rel="nofollow">mortench2004@yahoo.dk> wrote:

Thanks for the replies.

Yes to both questions (eclipse folder IS writable and weaving is enabled).

On the other hand, I can not se what the relevance is ? The NoClassDefFoundError bug I get is clearly because the plugin forgets the last letter in the class name as I noted before. I.e. a logical bug !!

Also, I can't understand why anybody can use this plugin without being able to run code ?

--- Den søn 12/7/09 skrev Naftoli Gugenhem <naftoligug [at] gmail [dot] com" href="/mc/compose?to=naftoligug@gmail.com" rel="nofollow">naftoligug@gmail.com>:

Fra: Naftoli Gugenhem <naftoligug [at] gmail [dot] com" href="/mc/compose?to=naftoligug@gmail.com" rel="nofollow">naftoligug@gmail.com>
Emne: Re: [scala-tools] Eclipse plugin too buggy for my Hello World - Am I  doing anything wrong?
Til: ricky [dot] clarkson [at] gmail [dot] com" href="/mc/compose?to=ricky.clarkson@gmail.com" rel="nofollow">ricky.clarkson@gmail.com, mortench2004 [at] yahoo [dot] dk" href="/mc/compose?to=mortench2004@yahoo.dk" rel="nofollow">mortench2004@yahoo.dk
Cc: scala-tools [at] listes [dot] epfl [dot] ch" href="/mc/compose?to=scala-tools@listes.epfl.ch" rel="nofollow">scala-tools@listes.epfl.ch
Dato: søndag 12. juli 2009 21.17

Yes, it's in serious use. :)
Is your eclipse folder writeable (not necessary for 3.5) and is JDT weaving enabled?

-------------------------------------
Ricky Clarkson<ricky [dot] clarkson [at] gmail [dot] com" href="/mc/compose?to=ricky.clarkson@gmail.com" rel="nofollow">ricky.clarkson@gmail.com> wrote:

No, it's not ready for serious use.  Miles apparently is getting quite
close to getting it there.  It is maintained, no worries on that
score.  Watch this list for an update on usability.

The IDEA plugin seems more complete.

2009/7/12 Morten <mortench2004 [at] yahoo [dot] dk" href="/mc/compose?to=mortench2004@yahoo.dk" rel="nofollow">mortench2004@yahoo.dk>:
> I am new to Scala but decided to give it a try today and installed the
> newest 2.7.5final Eclipse Plugin for Eclipse 3.4 on my Mac OS X 10.5. Just
> in the first 2 minutes of testing I ran into two bugs - one of them fatal -
> which leads me to ask if this plugin is indeed ready for serious use or if I
> am doing anything wrong ?
>
> THE BUGS:
> After install+restart I created a new java projected, added scala nature and
> added a package "testpackage" with a new scala file ScalaTest.scala:
>
> package testpackage
> object ScalaTest {
>     def main(args: Array[String]) {
>       println("Hello, world!")
>     }
> }
>
> When I right click on the file and select "Run as scala application" I get
> this exception:
> Exception in thread "main" java.lang.NoClassDefFoundError:
> testpackage/ScalaTes
> Caused by: java.lang.ClassNotFoundException: testpackage.ScalaTes
>     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
>     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
>     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:402)
>
> Note that the class the plugin tries to run lacks a "t" at the end, so it
> seems to be a bug in the plugin (properly some sub-string operation going
> wrong). Apart from this fatal bug, I also notice that plugin copies *.scala
> files to the build directory which consequently contains a mix of source
> code and *.class files. Hence any generated jar files will incorrectly
> contain source files as well.
>
> So in conclusion, I have manged to run into one fatal bug and one minor bug
> in just 2 minutes for my first try of the plugin. How are the experience
> from other developers on this list ?
>
> P.S. No I did not report this as bug request. Generally, to do that I need
> to be convinced that the software is usable and maintained. I am willing to
> give the eclipse plugin the benefit of the doubt though which is why have
> written the msg.
>
>
> ________________________________
> Få en billig laptop. Se Kelkoos gode tilbud her!



--
Ricky Clarkson
Java Programmer, AD Holdings
+44 1565 770804
Skype: ricky_clarkson
Google Talk: ricky [dot] clarkson [at] gmail [dot] com" href="/mc/compose?to=ricky.clarkson@gmail.com" rel="nofollow">ricky.clarkson@gmail.com



      Trænger du til at se det store billede? Kelkoo giver dig gode tilbud på LCD TV! Se her http://dk.yahoo.com/r/pat/lcd



      ___________________________________________________________
Skal du købe ny bil? Sammenlign priser på brugte biler med Kelkoo og find et godt tilbud! - Se mere her http://dk.yahoo.com/r/pat/mmb


Få en billig laptop. Se Kelkoos gode tilbud her!
Naftoli Gugenheim
Joined: 2008-12-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Eclipse plugin too buggy for my Hello World - Am I doing a

Instead of mixing static methods and instance methods in one class body as Java does, Scala defines a concept of a singleton object, which is the purpose of the object keyword. However, the bytecode output depends currently on whether the object is a companion object, i.e., there is a class in the same file with the same name. It could be it's also different if it's not top level.
To generate a main method properly it should not be a companion object.
What is the contents of your .project? Can you run it from the command line after eclipse builds it? What class files does it create? What is the output from javap on them?

-------------------------------------
Morten wrote:

As noted, both problems also occur with a freshly installed Eclipse 3.5 (on Windows) !

And, yes for my older elipse 3.4 I did check and JDT weaving as enabled already.

I am curious ? Can you reproduce ?

To Reproduce: create JAVA project "scalatest" + add scala nature + add package "testpackage" + add ScalaTest.scala as detailed ?

Morten
Joined: 2009-07-12,
User offline. Last seen 42 years 45 weeks ago.
Re: Eclipse plugin too buggy for my Hello World - Am I doing a
Thanks for the explaination (I have order the Scala book as I can read I need it :-))

Yea, I think now the last problem I had was that I first created a Scala class using the wizard and then when run did not work I changed it to an object my changing the keyword "class" to "object". This apparently confuses the plugin so a full "Clean" is necessary as a workaround. After clean I got it to work.

--- Den søn 12/7/09 skrev Naftoli Gugenhem <naftoligug@gmail.com>:

Fra: Naftoli Gugenhem <naftoligug@gmail.com>
Emne: Re: [scala-tools] Eclipse plugin too buggy for my Hello World - Am I doing anything wrong?
Til: mortench2004@yahoo.dk, miles@milessabin.com
Cc: scala-tools@listes.epfl.ch
Dato: søndag 12. juli 2009 23.52

Instead of mixing static methods and instance methods in one class body as Java does, Scala defines a concept of a singleton object, which is the purpose of the object keyword. However, the bytecode output depends currently on whether the object is a companion object, i.e., there is a class in the same file with the same name. It could be it's also different if it's not top level.
To generate a main method properly it should not be a companion object.
What is the contents of your .project? Can you run it from the command line after eclipse builds it? What class files does it create? What is the output from javap on them?

-------------------------------------
Morten<mortench2004 [at] yahoo [dot] dk" href="/mc/compose?to=mortench2004@yahoo.dk" rel="nofollow">mortench2004@yahoo.dk> wrote:

As noted, both problems also occur with a freshly installed Eclipse 3.5 (on Windows) !

And, yes for my older elipse 3.4 I did check and JDT weaving as enabled already.

I am curious ? Can you reproduce ?

To Reproduce: create JAVA project "scalatest" + add scala nature + add package "testpackage" + add ScalaTest.scala as detailed ?

--- Den søn 12/7/09 skrev Miles Sabin <miles [at] milessabin [dot] com" href="/mc/compose?to=miles@milessabin.com" rel="nofollow">miles@milessabin.com>:

Fra: Miles Sabin <miles [at] milessabin [dot] com" href="/mc/compose?to=miles@milessabin.com" rel="nofollow">miles@milessabin.com>
Emne: Re: [scala-tools] Eclipse plugin too buggy for my Hello World - Am I  doing anything wrong?
Til: "Morten" <mortench2004 [at] yahoo [dot] dk" href="/mc/compose?to=mortench2004@yahoo.dk" rel="nofollow">mortench2004@yahoo.dk>
Cc: scala-tools [at] listes [dot] epfl [dot] ch" href="/mc/compose?to=scala-tools@listes.epfl.ch" rel="nofollow">scala-tools@listes.epfl.ch
Dato: søndag 12. juli 2009 23.21

On Sun, Jul 12, 2009 at 8:04 PM, Morten<mortench2004 [at] yahoo [dot] dk" href="/mc/compose?to=mortench2004@yahoo.dk" rel="nofollow">mortench2004@yahoo.dk> wrote:
> Apart from this fatal bug, I also notice that plugin copies *.scala
> files to the build directory which consequently contains a mix of source
> code and *.class files. Hence any generated jar files will incorrectly
> contain source files as well.

This is a sure indication that whatever the appearances JDT Weaving is
not installed and/or enabled correctly.

You mentioned you were using Eclipse 3.4 ... the currently supported
versions are 3.4.2 and 3.5. Please upgrade and try again and get back
to me if you're still having problems.

Cheers,


Miles

--
Miles Sabin
tel: +44 (0)7813 944 528
skype:  milessabin
http://www.chuusai.com/
http://twitter.com/milessabin



      Find din nye laptop på kelkoo.dk. Se de gode tilbud her - http://dk.yahoo.com/r/pat/mm


Find din nye laptop på kelkoo.dk. Se de gode tilbud her!
Naftoli Gugenheim
Joined: 2008-12-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Eclipse plugin too buggy for my Hello World - Am I doing a

Your theory makes sense, because if it was a companion it would have to strip the trailing $, so you surprised it by creating a standalone singleton.
Miles, could that be?
As general rule (I keep forgetting this) if you're getting an error that makes no sense, do a clean. Actually there are rare times that it's necessary to do two cleans, apparently.

-------------------------------------
Morten wrote:

Thanks for the explaination (I have order the Scala book as I can read I need it :-))

Yea, I think now the last problem I had was that I first created a Scala class using the wizard and then when run did not work I changed it to an object my changing the keyword "class" to "object". This apparently confuses the plugin so a full "Clean" is necessary as a workaround. After clean I got it to work.

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