Creating Scala project from existing source doesn't add Scala library to .classpath
Eclipse Version 3.5.2 (thats what Eclipse itself reports. It does not say whether its Galileo, Helios, Africa or Leonardo da Vinci ...
After an automatic update I tried to create a Scala project from existing source files and I got :
"Failure in presentation compiler " in plug-in org.scala-ide.sdt.core ... again and again
Have no idea whats wrong. Tried it also with a brand new project and got also an error. (Added error description below)
TIA
Joe Herrmann
eclipse.buildId=M20100211-1343
java.version=1.6.0_12
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB
Command-line arguments: -os win32 -ws win32 -arch x86
Error
Tue Aug 17 22:35:53 GMT+04:00 2010
Failure in presentation compiler
scala.tools.nsc.MissingRequirementError: object scala not found.
at scala.tools.nsc.symtab.Definitions$definitions$.getModuleOrClass(Definitions.scala:513)
at scala.tools.nsc.symtab.Definitions$definitions$.ScalaPackage(Definitions.scala:37)
at scala.tools.nsc.symtab.Definitions$definitions$.ScalaPackageClass(Definitions.scala:38)
at scala.tools.nsc.symtab.Definitions$definitions$.UnitClass(Definitions.scala:83)
at scala.tools.nsc.symtab.Definitions$definitions$.init(Definitions.scala:785)
at scala.tools.nsc.Global$Run.<init>(Global.scala:597)
at scala.tools.nsc.interactive.Global$TyperRun.<init>(Global.scala:473)
at scala.tools.eclipse.ScalaPresentationCompiler$EclipseTyperRun.<init>(ScalaPresentationCompiler.scala:112)
at scala.tools.eclipse.ScalaPresentationCompiler.newTyperRun(ScalaPresentationCompiler.scala:155)
at scala.tools.eclipse.ScalaPresentationCompiler.newTyperRun(ScalaPresentationCompiler.scala:26)
at scala.tools.nsc.interactive.Global.reloadSources(Global.scala:289)
at scala.tools.nsc.interactive.Global.typedTree(Global.scala:319)
at scala.tools.nsc.interactive.Global$$anonfun$getTypedTree$1.apply(Global.scala:331)
at scala.tools.nsc.interactive.Global$$anonfun$getTypedTree$1.apply(Global.scala:331)
at scala.tools.nsc.interactive.Global.respond(Global.scala:276)
at scala.tools.nsc.interactive.Global.getTypedTree(Global.scala:331)
at scala.tools.nsc.interactive.CompilerControl$$anon$3.apply$mcV$sp(CompilerControl.scala:95)
at scala.tools.nsc.interactive.Global.pollForWork(Global.scala:132)
at scala.tools.nsc.interactive.Global$$anon$2.run(Global.scala:192)
THE NEW PROJECT :
eclipse.buildId=M20100211-1343
java.version=1.6.0_12
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB
Command-line arguments: -os win32 -ws win32 -arch x86
Error
Tue Aug 17 22:52:19 GMT+04:00 2010
-1
java.lang.ArrayIndexOutOfBoundsException: -1
at scala.tools.refactoring.common.PimpedTrees$class.fixTreePositionIncludingCarriageReturn(PimpedTrees.scala:217)
at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1$$anon$1.fixTreePositionIncludingCarriageReturn(ScalaOccurrencesFinder.scala:21)
at scala.tools.refactoring.analysis.CompilationUnitIndexes$CompilationUnitIndex$$anonfun$processTree$1$1.apply(CompilationUnitIndexes.scala:63)
at scala.tools.refactoring.analysis.CompilationUnitIndexes$CompilationUnitIndex$$anonfun$processTree$1$1.apply(CompilationUnitIndexes.scala:45)
at scala.tools.nsc.ast.Trees$ForeachTreeTraverser.traverse(Trees.scala:1009)
at scala.reflect.generic.Trees$Traverser.traverse(Trees.scala:463)
at scala.tools.nsc.ast.Trees$Traverser.traverse(Trees.scala:881)
at scala.tools.nsc.ast.Trees$ForeachTreeTraverser.traverse(Trees.scala:1010)
at scala.tools.nsc.ast.Trees$TreeOps.foreach(Trees.scala:61)
at scala.tools.refactoring.analysis.CompilationUnitIndexes$CompilationUnitIndex$.processTree$1(CompilationUnitIndexes.scala:45)
at scala.tools.refactoring.analysis.CompilationUnitIndexes$CompilationUnitIndex$.apply(CompilationUnitIndexes.scala:95)
at scala.tools.refactoring.analysis.GlobalIndexes$GlobalIndex$.apply(GlobalIndexes.scala:33)
at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1$$anonfun$apply$1.apply(ScalaOccurrencesFinder.scala:36)
at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1$$anonfun$apply$1.apply(ScalaOccurrencesFinder.scala:27)
at scala.Option.flatMap(Option.scala:81)
at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1.apply(ScalaOccurrencesFinder.scala:27)
at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1.apply(ScalaOccurrencesFinder.scala:20)
at scala.tools.eclipse.util.Cached$$anonfun$apply$3.apply(Cached.scala:58)
at scala.tools.eclipse.util.Cached$class.locked(Cached.scala:83)
at scala.tools.eclipse.util.Cached$class.apply(Cached.scala:56)
at scala.tools.eclipse.ScalaPresentationCompiler$CachedCompilerResult.apply(ScalaPresentationCompiler.scala:67)
at scala.tools.eclipse.ScalaPresentationCompiler.withCompilerResult(ScalaPresentationCompiler.scala:90)
at scala.tools.eclipse.ScalaProject$$anonfun$withCompilerResult$1.apply(ScalaProject.scala:368)
at scala.tools.eclipse.ScalaProject$$anonfun$withCompilerResult$1.apply(ScalaProject.scala:367)
at scala.tools.eclipse.util.Cached$$anonfun$apply$1.apply$mcV$sp(Cached.scala:22)
at scala.tools.eclipse.util.Cached$$anonfun$apply$1.apply(Cached.scala:21)
at scala.tools.eclipse.util.Cached$$anonfun$apply$1.apply(Cached.scala:21)
at scala.tools.eclipse.util.Cached$class.locked(Cached.scala:83)
at scala.tools.eclipse.util.Cached$class.apply(Cached.scala:20)
at scala.tools.eclipse.ScalaProject$$anon$1.apply(ScalaProject.scala:39)
at scala.tools.eclipse.ScalaProject.withPresentationCompiler(ScalaProject.scala:363)
at scala.tools.eclipse.ScalaProject.withCompilerResult(ScalaProject.scala:367)
at scala.tools.eclipse.javaelements.ScalaCompilationUnit$$anonfun$withCompilerResult$1.apply(ScalaCompilationUnit.scala:49)
at scala.tools.eclipse.javaelements.ScalaCompilationUnit$class.withDocument(ScalaCompilationUnit.scala:41)
at scala.tools.eclipse.javaelements.ScalaSourceFile.withDocument(ScalaSourceFile.scala:40)
at scala.tools.eclipse.javaelements.ScalaCompilationUnit$class.withCompilerResult(ScalaCompilationUnit.scala:49)
at scala.tools.eclipse.javaelements.ScalaSourceFile.withCompilerResult(ScalaSourceFile.scala:40)
at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder.findOccurrences(ScalaOccurrencesFinder.scala:20)
at scala.tools.eclipse.ScalaSourceFileEditor.getAnnotations(ScalaSourceFileEditor.scala:111)
at scala.tools.eclipse.ScalaSourceFileEditor.updateOccurrenceAnnotations(ScalaSourceFileEditor.scala:99)
at scala.tools.eclipse.ScalaSourceFileEditor$$anon$1.selectionChanged(ScalaSourceFileEditor.scala:134)
at org.eclipse.ui.internal.AbstractSelectionService.firePostSelection(AbstractSelectionService.java:179)
at org.eclipse.ui.internal.AbstractSelectionService$2.selectionChanged(AbstractSelectionService.java:71)
at org.eclipse.jface.text.TextViewer.firePostSelectionChanged(TextViewer.java:2731)
at org.eclipse.jface.text.TextViewer.firePostSelectionChanged(TextViewer.java:2679)
at org.eclipse.jface.text.TextViewer$5.run(TextViewer.java:2658)
at org.eclipse.swt.widgets.Display.runTimer(Display.java:3973)
at org.eclipse.swt.widgets.Display.messageProc(Display.java:3165)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2411)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3501)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
After an automatic update I tried to create a Scala project from existing source files and I got :
"Failure in presentation compiler " in plug-in org.scala-ide.sdt.core ... again and again
Have no idea whats wrong. Tried it also with a brand new project and got also an error. (Added error description below)
TIA
Joe Herrmann
eclipse.buildId=M20100211-1343
java.version=1.6.0_12
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB
Command-line arguments: -os win32 -ws win32 -arch x86
Error
Tue Aug 17 22:35:53 GMT+04:00 2010
Failure in presentation compiler
scala.tools.nsc.MissingRequirementError: object scala not found.
at scala.tools.nsc.symtab.Definitions$definitions$.getModuleOrClass(Definitions.scala:513)
at scala.tools.nsc.symtab.Definitions$definitions$.ScalaPackage(Definitions.scala:37)
at scala.tools.nsc.symtab.Definitions$definitions$.ScalaPackageClass(Definitions.scala:38)
at scala.tools.nsc.symtab.Definitions$definitions$.UnitClass(Definitions.scala:83)
at scala.tools.nsc.symtab.Definitions$definitions$.init(Definitions.scala:785)
at scala.tools.nsc.Global$Run.<init>(Global.scala:597)
at scala.tools.nsc.interactive.Global$TyperRun.<init>(Global.scala:473)
at scala.tools.eclipse.ScalaPresentationCompiler$EclipseTyperRun.<init>(ScalaPresentationCompiler.scala:112)
at scala.tools.eclipse.ScalaPresentationCompiler.newTyperRun(ScalaPresentationCompiler.scala:155)
at scala.tools.eclipse.ScalaPresentationCompiler.newTyperRun(ScalaPresentationCompiler.scala:26)
at scala.tools.nsc.interactive.Global.reloadSources(Global.scala:289)
at scala.tools.nsc.interactive.Global.typedTree(Global.scala:319)
at scala.tools.nsc.interactive.Global$$anonfun$getTypedTree$1.apply(Global.scala:331)
at scala.tools.nsc.interactive.Global$$anonfun$getTypedTree$1.apply(Global.scala:331)
at scala.tools.nsc.interactive.Global.respond(Global.scala:276)
at scala.tools.nsc.interactive.Global.getTypedTree(Global.scala:331)
at scala.tools.nsc.interactive.CompilerControl$$anon$3.apply$mcV$sp(CompilerControl.scala:95)
at scala.tools.nsc.interactive.Global.pollForWork(Global.scala:132)
at scala.tools.nsc.interactive.Global$$anon$2.run(Global.scala:192)
THE NEW PROJECT :
eclipse.buildId=M20100211-1343
java.version=1.6.0_12
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB
Command-line arguments: -os win32 -ws win32 -arch x86
Error
Tue Aug 17 22:52:19 GMT+04:00 2010
-1
java.lang.ArrayIndexOutOfBoundsException: -1
at scala.tools.refactoring.common.PimpedTrees$class.fixTreePositionIncludingCarriageReturn(PimpedTrees.scala:217)
at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1$$anon$1.fixTreePositionIncludingCarriageReturn(ScalaOccurrencesFinder.scala:21)
at scala.tools.refactoring.analysis.CompilationUnitIndexes$CompilationUnitIndex$$anonfun$processTree$1$1.apply(CompilationUnitIndexes.scala:63)
at scala.tools.refactoring.analysis.CompilationUnitIndexes$CompilationUnitIndex$$anonfun$processTree$1$1.apply(CompilationUnitIndexes.scala:45)
at scala.tools.nsc.ast.Trees$ForeachTreeTraverser.traverse(Trees.scala:1009)
at scala.reflect.generic.Trees$Traverser.traverse(Trees.scala:463)
at scala.tools.nsc.ast.Trees$Traverser.traverse(Trees.scala:881)
at scala.tools.nsc.ast.Trees$ForeachTreeTraverser.traverse(Trees.scala:1010)
at scala.tools.nsc.ast.Trees$TreeOps.foreach(Trees.scala:61)
at scala.tools.refactoring.analysis.CompilationUnitIndexes$CompilationUnitIndex$.processTree$1(CompilationUnitIndexes.scala:45)
at scala.tools.refactoring.analysis.CompilationUnitIndexes$CompilationUnitIndex$.apply(CompilationUnitIndexes.scala:95)
at scala.tools.refactoring.analysis.GlobalIndexes$GlobalIndex$.apply(GlobalIndexes.scala:33)
at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1$$anonfun$apply$1.apply(ScalaOccurrencesFinder.scala:36)
at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1$$anonfun$apply$1.apply(ScalaOccurrencesFinder.scala:27)
at scala.Option.flatMap(Option.scala:81)
at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1.apply(ScalaOccurrencesFinder.scala:27)
at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1.apply(ScalaOccurrencesFinder.scala:20)
at scala.tools.eclipse.util.Cached$$anonfun$apply$3.apply(Cached.scala:58)
at scala.tools.eclipse.util.Cached$class.locked(Cached.scala:83)
at scala.tools.eclipse.util.Cached$class.apply(Cached.scala:56)
at scala.tools.eclipse.ScalaPresentationCompiler$CachedCompilerResult.apply(ScalaPresentationCompiler.scala:67)
at scala.tools.eclipse.ScalaPresentationCompiler.withCompilerResult(ScalaPresentationCompiler.scala:90)
at scala.tools.eclipse.ScalaProject$$anonfun$withCompilerResult$1.apply(ScalaProject.scala:368)
at scala.tools.eclipse.ScalaProject$$anonfun$withCompilerResult$1.apply(ScalaProject.scala:367)
at scala.tools.eclipse.util.Cached$$anonfun$apply$1.apply$mcV$sp(Cached.scala:22)
at scala.tools.eclipse.util.Cached$$anonfun$apply$1.apply(Cached.scala:21)
at scala.tools.eclipse.util.Cached$$anonfun$apply$1.apply(Cached.scala:21)
at scala.tools.eclipse.util.Cached$class.locked(Cached.scala:83)
at scala.tools.eclipse.util.Cached$class.apply(Cached.scala:20)
at scala.tools.eclipse.ScalaProject$$anon$1.apply(ScalaProject.scala:39)
at scala.tools.eclipse.ScalaProject.withPresentationCompiler(ScalaProject.scala:363)
at scala.tools.eclipse.ScalaProject.withCompilerResult(ScalaProject.scala:367)
at scala.tools.eclipse.javaelements.ScalaCompilationUnit$$anonfun$withCompilerResult$1.apply(ScalaCompilationUnit.scala:49)
at scala.tools.eclipse.javaelements.ScalaCompilationUnit$class.withDocument(ScalaCompilationUnit.scala:41)
at scala.tools.eclipse.javaelements.ScalaSourceFile.withDocument(ScalaSourceFile.scala:40)
at scala.tools.eclipse.javaelements.ScalaCompilationUnit$class.withCompilerResult(ScalaCompilationUnit.scala:49)
at scala.tools.eclipse.javaelements.ScalaSourceFile.withCompilerResult(ScalaSourceFile.scala:40)
at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder.findOccurrences(ScalaOccurrencesFinder.scala:20)
at scala.tools.eclipse.ScalaSourceFileEditor.getAnnotations(ScalaSourceFileEditor.scala:111)
at scala.tools.eclipse.ScalaSourceFileEditor.updateOccurrenceAnnotations(ScalaSourceFileEditor.scala:99)
at scala.tools.eclipse.ScalaSourceFileEditor$$anon$1.selectionChanged(ScalaSourceFileEditor.scala:134)
at org.eclipse.ui.internal.AbstractSelectionService.firePostSelection(AbstractSelectionService.java:179)
at org.eclipse.ui.internal.AbstractSelectionService$2.selectionChanged(AbstractSelectionService.java:71)
at org.eclipse.jface.text.TextViewer.firePostSelectionChanged(TextViewer.java:2731)
at org.eclipse.jface.text.TextViewer.firePostSelectionChanged(TextViewer.java:2679)
at org.eclipse.jface.text.TextViewer$5.run(TextViewer.java:2658)
at org.eclipse.swt.widgets.Display.runTimer(Display.java:3973)
at org.eclipse.swt.widgets.Display.messageProc(Display.java:3165)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2411)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3501)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
Leave a comment
I believe I'm getting the same error. Brand new Eclipse Galileo SR2 install with Scala IDE from http://download.scala-ide.org/update-current-35 - all items selected. This is on Windows 7, JDK 1.6.0_20-b02; . I'm getting the -1 index out of bounds exception at scala.tools.refactoring.common.PimpedTrees$class.fixTreePositionIncludingCarriageReturn(PimpedTrees.scala:217);
Recreateable at will. Simply create a new scala project, create a new Scala application and edit it - as the mouse is clicked at various points in the new file, the error occurs.
ralphwking at hotmail dot com
Recreateable at will. Simply create a new scala project, create a new Scala application and edit it - as the mouse is clicked at various points in the new file, the error occurs.
ralphwking at hotmail dot com
on 2010-08-18 12:20 *
By Mirko Stocker
I just fixed the error about the fixTreePositionIncludingCarriageReturn, should be in the next nightly build. But I think the failure in presentation compiler is a different error.
on 2010-08-18 13:54 *
By
In general is this triggered by Windows-style line end codes?
on 2010-08-18 14:01 *
By Mirko Stocker
You mean the fixTreePositionIncludingCarriageReturn? My implementation was faulty, I didn't expect that there are trees which have 0 as their end position and used position.end - 1 as index to the source file...
on 2010-08-18 14:55 *
By
Gotcha ... I thought this might be related to http://lampsvn.epfl.ch/trac/scala/ticket/3765.
on 2010-08-18 15:35 *
By
I've just pushed out fresh IDE builds (all permutations) including Mirko's fix. Could you give it a try (update from the update site again) and report back.
on 2010-08-18 18:43 *
By
Any sign of the other issue (ie. the "Failure in presentation compiler ... scala.tools.nsc.MissingRequirementError: object scala not found")?
on 2010-08-18 19:15 *
By
How are you importing these sources? What do the resulting project's .project and .classpath files look like?
File->New->Scala Project
Create project from existing source
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>RWKScalaSandbox</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.scala-ide.sdt.core.scalabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.scala-ide.sdt.core.scalanature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Ralph King
Create project from existing source
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>RWKScalaSandbox</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.scala-ide.sdt.core.scalabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.scala-ide.sdt.core.scalanature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Ralph King
on 2010-08-18 19:32 *
By
OK, so your problem is that your .classpath file is missing the reference to the Scala library classpath container. To fix it right click on the project then Properties => Java Build Path => Libraries => Add Library ... then select Scala Library and hit Finish.
But the question remains: how did you do this import? What's puzzling me is that you have the Scala nature present in your .project file, and any mechanism which added that entry ought also to have added the Scala library classpath container to your .classpath at the same time.
But the question remains: how did you do this import? What's puzzling me is that you have the Scala nature present in your .project file, and any mechanism which added that entry ought also to have added the Scala library classpath container to your .classpath at the same time.
Thanks, that fixed it. Are you asking a different question about import than I answered above? I simply selected new from the File menu, specified "Scala Project", and on the first screen selected "Create project from existing source", clicked on "Browse" and navigated to the parent of the "src" directory.
Ralph King
Ralph King
on 2010-08-18 19:59 *
By
Thanks for the update.
Could you try the import again. But first delete the existing .classpath and .project files then let us know what the regenerated files look like.
Could you try the import again. But first delete the existing .classpath and .project files then let us know what the regenerated files look like.
OK, hopefully I took the steps you intended. I assume you didn't mean for me to repeat my original recreation since I would expect that the results would be identical. So I deleted the project (and didn't select the checkbox to delete the contents on disk), then deleted the 2 files you specified. So the new experiment differs from the first in that the bin directory remains along with the .scala_dependencies file. Created a new project as before specifying the same directory. Presentation compiler error returns. Contents of the 2 files:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>RWKScalaSandbox2</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.scala-ide.sdt.core.scalabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.scala-ide.sdt.core.scalanature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>RWKScalaSandbox2</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.scala-ide.sdt.core.scalabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.scala-ide.sdt.core.scalanature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
OK, thanks ... that's very helpful.
on 2010-08-18 20:57 *
By
Summary changed from Failure in presentation compiler to Creating Scala project from existing source doesn't add Scala library to .classpath
Hi,
have also updated the plug-in and have then removed any projects from the Eclipse Package explorer. Have also removed all files and subdirs with exception of the 2 .scala source files.
After the restart of Eclipse I created a new project using those existing .scala files and ran again into the "Failure in the presentation compiler"
I then inspected the workspace/summer subdir (summer = projectname) and found that Eclipse has created 2 subdirs: 'bin' and 'src' and the files .classpath and .project.
Comparing this with a new scala project without using existing sources I could see the following differences :
1. The source files are now under the subdir .src
2. subdir '.settings' exists
3. file '.scala_dependencies' exists
4. in subdir '.bin' are .class files
All this is missing if the project is created with existing source files.
Deleted the entire project subdir again and created a subdir outside of the 'workspace' scope and tried to create a new project with these existing sources . Same problem as before.
I don't know how Eclipse in such a case is intended to behave and does with Java, but my personal opinion is that :
1. Eclipse should only accept source files below the current workspace subdir if they are completly structured in the Eclipse project way : have .src .bin ,classpath etc. This would allow to revive somewhere else stored old projects or lost projects after a crash.If something in the structure is missing, the project should be considered as damaged and one has to copy the scala sources outside the workspace subdir tree and use 2.
2. It should accept source files outside of the current workspace without the Eclipse project structure, but should then create a new project below the current workspace subdir with the eclipse structure and copy then the source files into this structure, leaving the originals untouched.
3. Scala sources with a correct Eclipse structur outside of the current workspace subir should remain there and should be accpeted and used as is.
Joe Herrmann
have also updated the plug-in and have then removed any projects from the Eclipse Package explorer. Have also removed all files and subdirs with exception of the 2 .scala source files.
After the restart of Eclipse I created a new project using those existing .scala files and ran again into the "Failure in the presentation compiler"
I then inspected the workspace/summer subdir (summer = projectname) and found that Eclipse has created 2 subdirs: 'bin' and 'src' and the files .classpath and .project.
Comparing this with a new scala project without using existing sources I could see the following differences :
1. The source files are now under the subdir .src
2. subdir '.settings' exists
3. file '.scala_dependencies' exists
4. in subdir '.bin' are .class files
All this is missing if the project is created with existing source files.
Deleted the entire project subdir again and created a subdir outside of the 'workspace' scope and tried to create a new project with these existing sources . Same problem as before.
I don't know how Eclipse in such a case is intended to behave and does with Java, but my personal opinion is that :
1. Eclipse should only accept source files below the current workspace subdir if they are completly structured in the Eclipse project way : have .src .bin ,classpath etc. This would allow to revive somewhere else stored old projects or lost projects after a crash.If something in the structure is missing, the project should be considered as damaged and one has to copy the scala sources outside the workspace subdir tree and use 2.
2. It should accept source files outside of the current workspace without the Eclipse project structure, but should then create a new project below the current workspace subdir with the eclipse structure and copy then the source files into this structure, leaving the originals untouched.
3. Scala sources with a correct Eclipse structur outside of the current workspace subir should remain there and should be accpeted and used as is.
Joe Herrmann
on 2010-08-19 00:14 *
By
@Joe
Did you check the contents of your .classpath? The problem is exactly as the new title explains: creating a new Scala project from existing sources works perfectly with the exception that the Scala library classpath container isn't added to the new project .classpath file. If you follow the steps I described above you should have a fully functional Scala project.
Wrt you other comments ... this is supposed to work in exactly the same way as it does for Java.
Did you check the contents of your .classpath? The problem is exactly as the new title explains: creating a new Scala project from existing sources works perfectly with the exception that the Scala library classpath container isn't added to the new project .classpath file. If you follow the steps I described above you should have a fully functional Scala project.
Wrt you other comments ... this is supposed to work in exactly the same way as it does for Java.
Updating tickets (#1000069, #1000195, #1000213, #1000223, #1000006, #1000021, #1000038, #1000048, #1000051, #1000052, #1000075, #1000103, #1000109, #1000115, #1000119, #1000156, #1000186, #1000207, #1000238, #1000262, #1000263, #380, #389, #683, #1238, #1331, #1635, #1645, #1715, #1729, #1744, #1783, #1839, #1869, #1885, #1890, #1902, #1918, #1919, #1924, #1925, #1946, #1964, #1991, #2131, #2233, #2342, #2348, #2408, #2459, #2499, #2523, #2572, #2582, #2602, #2614, #2615, #2675, #2710, #2745, #2763, #2816, #2830, #2834, #2878, #2879, #2887, #2888, #2901, #2911, #2912, #2922, #2937, #2938, #2942, #2951, #2955, #2957, #2961, #2964, #2965, #2974, #2975, #2989, #2990, #3002, #3055, #3070, #3087, #3135, #3139, #3173, #3182, #3184, #3200, #3213, #3214, #3221, #3243, #3251)
on 2011-03-24 22:48 *
By Iulian Dragos
Updating tickets (#1000199, #1000200, #1000201, #1000204, #1000205, #1000209, #1000210, #1000211, #1000212, #1000215, #1000217, #1000218, #1000220, #1000222, #1000226, #1000227, #1000228, #1000230, #1000231, #1000232, #1000233, #1000235, #1000236, #1000237, #1000239, #1000240, #1000241, #1000242, #1000243, #1000244, #1000248, #1000249, #1000252, #1000253, #1000254, #1000255, #1000256, #1000258, #1000259, #1000032, #1000059, #1000062, #1000163, #1000197, #1000216, #1000221, #1000224, #1000121, #1000175, #1000219, #1000251, #1000069, #1000195, #1000213, #1000223, #1000006, #1000021, #1000038, #1000048, #1000051, #1000052, #1000075, #1000103, #1000109, #1000115, #1000119, #1000156, #1000186, #1000207, #1000238, #1000262, #1000263, #380, #389, #683, #1238, #1331, #1635, #1645, #1715, #1729, #1744, #1783, #1839, #1869, #1885, #1890, #1902, #1918, #1919, #1924, #1925, #1946, #1964, #1991, #2131, #2233, #2342, #2348, #2408)