Plugin message: "Failed to initialize Scala compiler properly"

870 vues
Accéder directement au premier message non lu

André van Delft

non lue,
12 mai 2011, 19:27:2212/05/2011
à Scala IDE User
I have installed the Scala plugin for Eclipse. It works for a simple
Scala project.

I also downloaded the code for Scala itself from http://lampsvn.epfl.ch/svn-repos/scala.
There the Scala plugin complains:

Failed to initialize Scala compiler properly. Path must include
project and resource name: /scala. The editor will not try to re-
initialize the compiler until you change the classpath and reopen
project scala .

Errors occurred during the build.
Errors running builder 'Scala Builder' on project 'scala'.
Path must include project and resource name: /scala

I have Eclipse Helios 3.6.1 and the Scala plugin with compile 2.8.1.
Unfortunately, I cannot find the exact plugin Version, because Help-
About Eclipse now yields:

java.lang.NullPointerException
at java.io.FilterInputStream.close(Unknown Source)
at
org.eclipse.ui.internal.about.AboutBundleGroupData.getFeatureImageCrc(AboutBundleGroupData.java:
104)
...

eclipse.buildId=M20110210-1200
java.version=1.6.0_25
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=nl_NL
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product
org.eclipse.epp.package.java.product

I look forward to your help on both issues.

iulian dragos

non lue,
13 mai 2011, 02:12:0713/05/2011
à scala-i...@googlegroups.com
2011/5/13 André van Delft <andre.v...@gmail.com>:

> I have installed the Scala plugin for Eclipse. It works for a simple
> Scala project.
>
> I also downloaded the code for Scala itself from http://lampsvn.epfl.ch/svn-repos/scala.
> There the Scala plugin complains:
>
>        Failed to initialize Scala compiler properly. Path must include
> project and resource name: /scala. The editor will not try to re-
> initialize the compiler until you change the classpath and reopen
> project scala .

I realize the message may not be the clearest possible, but it does
point in the right direction: your project classpath. The Scala
repository does not contain a '.classpath' file (it may contain
user-specific entries). Just rename 'classpath.SAMPLE' to '.classpath'
and try again.

It must be said that the Scala (Eclipse) project only compiles the
compiler sources, not the library.

> I have Eclipse Helios 3.6.1 and the Scala plugin with compile 2.8.1.
> Unfortunately, I cannot find the exact plugin Version, because Help-
> About Eclipse now yields:

It's highly recommended you try one of the 2.0-beta versions, using
2.9.0.RC3. We'll probably release today a version in line with the
current Scala release (2.9).

iulian

>
> java.lang.NullPointerException
>        at java.io.FilterInputStream.close(Unknown Source)
>        at
> org.eclipse.ui.internal.about.AboutBundleGroupData.getFeatureImageCrc(AboutBundleGroupData.java:
> 104)
>        ...
>
> eclipse.buildId=M20110210-1200
> java.version=1.6.0_25
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=nl_NL
> Framework arguments:  -product org.eclipse.epp.package.java.product
> Command-line arguments:  -os win32 -ws win32 -arch x86 -product
> org.eclipse.epp.package.java.product
>
> I look forward to your help on both issues.

--
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais

Hubert Plociniczak

non lue,
13 mai 2011, 09:03:1613/05/2011
à Scala IDE User


On May 13, 8:12 am, iulian dragos <jagua...@gmail.com> wrote:
> 2011/5/13 André van Delft <andre.vande...@gmail.com>:
>
> > I have installed the Scala plugin for Eclipse. It works for a simple
> > Scala project.
>
> > I also downloaded the code for Scala itself fromhttp://lampsvn.epfl.ch/svn-repos/scala.
> > There the Scala plugin complains:
>
> >        Failed to initialize Scala compiler properly. Path must include
> > project and resource name: /scala. The editor will not try to re-
> > initialize the compiler until you change the classpath and reopen
> > project scala .
>
> I realize the message may not be the clearest possible, but it does
> point in the right direction: your project classpath. The Scala
> repository does not contain a '.classpath' file (it may contain
> user-specific entries). Just rename 'classpath.SAMPLE' to '.classpath'
> and try again.

Just to clarify. By "trying again" Iulian meant refreshing it and
clicking on Project -> Clean. You don't have to remove/add it again.

hubert

André van Delft

non lue,
14 mai 2011, 11:03:4914/05/2011
à Scala IDE User
Thanks for the replies. I had for several minutes a nice view on the
scala code with syntax hilighting.

1. However, the problem with the non working "Help-About Eclipse"
persisted; I think it was somehow caused by the Scala plugin. Do you
know how I can resolve this?

2. After browsing the scala code for a while, Eclipse started to eat
all CPU time, so I had to close the project.

3 After reopening, I got again "Unable to create editor ID
scala.tools.eclipse.ScalaSourceFileEditor: Editor could not be
initialized."
java.lang.IllegalStateException: failed to access value
at scala.tools.eclipse.ScalaProject.getOrFailed(ScalaProject.scala:90)
at
scala.tools.eclipse.ScalaProject.withPresentationCompiler(ScalaProject.scala:
421)
...
Caused by: Java Model Exception: Java Model Status [scala does not
exist]
at
org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:
492)
at
org.eclipse.jdt.internal.core.JavaModelManager.getPerProjectInfoCheckExistence(JavaModelManager.java:
2162)

4. I restarted Eclipse, and the Scala editor seems to work again on
project scala.
However there are lots of red lines for compilation errors.
For instance, in (scala.tools.nsc.) CompilerCommand.scala, the editor
reports on the line "import io.File" the error "File is not a member
of io.{<null>}"

I would appreciate your help again

iulian dragos

non lue,
14 mai 2011, 12:28:4114/05/2011
à scala-i...@googlegroups.com
First of all, you need to install the latest version of the IDE
(2.0.0-beta4). You cannot compile scala trunk with the 2.8.1 compiler.
I only recently realized the sad truth (but going the other way, using
the latest compiler with 2.8.1 sources). The latest release of Scala
is 2.9.0.final, so there is even less reason to remain on the old
version. The differences in usability between the two versions are
quite important. Martin, Hubert, I and possibly others use the Eclipse
plugin every day, on the Scala compiler sources, so it has to work for
you as well.

2011/5/14 André van Delft <andre.v...@gmail.com>:


> Thanks for the replies. I had for several minutes a nice view on the
> scala code with syntax hilighting.
>
> 1. However, the problem with the non working "Help-About Eclipse"
> persisted; I think it was somehow caused by the Scala plugin. Do you
> know how I can resolve this?

Unfortunately, I have no idea what might cause this, but please retry
with the latest beta. I use this feature all the time :)

>
> 2. After browsing the scala code for a while, Eclipse started to eat
> all CPU time, so I had to close the project.
>
> 3 After reopening, I got again "Unable to create editor ID
> scala.tools.eclipse.ScalaSourceFileEditor: Editor could not be
> initialized."
> java.lang.IllegalStateException: failed to access value
> at scala.tools.eclipse.ScalaProject.getOrFailed(ScalaProject.scala:90)
> at
> scala.tools.eclipse.ScalaProject.withPresentationCompiler(ScalaProject.scala:
> 421)
> ...
> Caused by: Java Model Exception: Java Model Status [scala does not
> exist]

This looks suspicious, since 'scala' is the currently open file. No idea.

> at
> org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:
> 492)
> at
> org.eclipse.jdt.internal.core.JavaModelManager.getPerProjectInfoCheckExistence(JavaModelManager.java:
> 2162)
>
> 4. I restarted Eclipse, and the Scala editor seems to work again on
> project scala.
> However there are lots of red lines for compilation errors.
> For instance, in (scala.tools.nsc.) CompilerCommand.scala, the editor
> reports on the line "import io.File" the error "File is not a member
> of io.{<null>}"
>
> I would appreciate your help again
>

It's most likely a classpath problem (once you have the right plugin).
You need to have the Scala Library on your classpath, together with
other dependencies in scala/lib (like fjbg.jar, msil.jar , ant.jar).
The sample project included in the SVN repository should take care of
them, though.

iulian

Rohan

non lue,
15 mai 2011, 04:36:2315/05/2011
à Scala IDE User
I am having the same issues on scala 2.8.1 plugin for eclipse ide.
my scala version is also 2.8.1
I am running Archlinux on a 64 bit machine.

On May 14, 9:28 pm, iulian dragos <jagua...@gmail.com> wrote:
> First of all, you need to install the latest version of the IDE
> (2.0.0-beta4). You cannot compile scala trunk with the 2.8.1 compiler.
> I only recently realized the sad truth (but going the other way, using
> the latest compiler with 2.8.1 sources). The latest release of Scala
> is 2.9.0.final, so there is even less reason to remain on the old
> version. The differences in usability between the two versions are
> quite important. Martin, Hubert, I and possibly others use the Eclipse
> plugin every day, on the Scala compiler sources, so it has to work for
> you as well.
>
> 2011/5/14 André van Delft <andre.vande...@gmail.com>:

David Bernard

non lue,
16 mai 2011, 07:44:1716/05/2011
à scala-i...@googlegroups.com
For users of scalaIDE 1.x for scala 2.8.1 like Rohan,
Can you open ticket and/or an email for each problem. I'm little
confuse in this thread.
And more important, provide the full stack trace.

1. "About ..."
  no idea, please open a ticket with full stacktrace

2. "...eat all CPU time...3
  display the memory used by eclipse (see setup in the wiki)
  If you don't have enough memory (after few time), GC will run
non-stop and eat CPU
  If it's not a memory/GC issue ... open a ticket with full stack
trace (use jstack or jvisualvm)

3. "... Unable to create editor ID ..."
  there are lot of cause, but it seems (with the info provided) that
eclipse didn't find a directory /scala (in the workspace)

4. "..."
What's append after "project > clean" ?

Cheers,

/davidB

Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message