object Main {
def main(args:Array[String]) { println("Main") }}
name := "akka-in-action.ch02"
version := "1.0"
scalaVersion := "2.11.7"
sbt eclipseakka-in-action.ch02's tests not built due to errors in dependent scope(s) main akka-in-action.ch02 Unknown Scala Problem
Error in Scala compiler: null akka-in-action.ch02 Unknown Scala Problem
SBT builder crashed while compiling. The error message is 'null'. Check Error Log for details. akka-in-action.ch02 Unknown Scala Problem
I created a project with sbt with one object and one method:
object Main {
def main(args:Array[String]) {println("Main")}}
I have a minimal build.sbt
name := "akka-in-action.ch02"
version := "1.0"
scalaVersion := "2.11.7"
I ransbt eclipse
and imported the project into scala-ide. Scala-ide reports these errors:
akka-in-action.ch02's tests not built due to errors in dependent scope(s) main akka-in-action.ch02 Unknown Scala Problem
Error in Scala compiler: null akka-in-action.ch02 Unknown Scala Problem
SBT builder crashed while compiling. The error message is 'null'. Check Error Log for details. akka-in-action.ch02 Unknown Scala Problem
This code compiles and runs under sbt.
Is this a problem with scala-ide or with sbt, or with trying to use them together?
I'm a longtime Eclipse/Java/Maven user and I've been working with Scala for a few weeks now. I can't believe how bad scala-ide is. I know it can't handle objects that extend App very well so I've gone to just putting the main() method in an object, but it can't handle that either.
Am I missing something or is scala-ide just this bad? Is the scala support in IntelliJ much better?
Thanks.
--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/8269da32-fbc4-4238-8a1f-d4ba643424ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Scala IDE User" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scala-ide-user/gPpwsthSPL0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scala-ide-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/e6e67a30-d1e1-408b-bc16-12181ee42e2b%40googlegroups.com.
<classpath>
<classpathentry kind="src" path="src\main\scala-2.11"/> <classpathentry kind="src" path="src\main\scala"/> <classpathentry kind="src" path="src\main\java"/> <classpathentry kind="src" path="src\main\resources"/> <classpathentry kind="src" path="src\test\scala-2.11"/> <classpathentry kind="src" path="src\test\scala"/> <classpathentry kind="src" path="src\test\java"/> <classpathentry kind="src" path="src\test\resources"/> <classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="output" path="bin"/></classpath><projectDescription> <name>dean-bug.ch03</name> <buildSpec> <buildCommand> <name>org.scala-ide.sdt.core.scalabuilder</name> </buildCommand> </buildSpec> <natures> <nature>org.scala-ide.sdt.core.scalanature</nature> <nature>org.eclipse.jdt.core.javanature</nature> </natures> <linkedResources> </linkedResources></projectDescription>To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/778e8fe8-09da-40d2-b84b-c7d19e66a2c0%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/5f9b849a-2648-4743-8d49-212c77158d01%40googlegroups.com.
The difference was that you used src/main/scala-2.11 and I used src/main/scala. When I renamed the scala/ dir to scala-2.11/ and re-ran sbt eclipse everything worked. No Exceptions and the error messages in scala-ide went away. I can also run the project in scala-ide which I couldn't before.
The "Getting Started with sbt" document says to use src/main/scala/ on pg. 11. Since it's necessary to use src/main/scala-2.11/ to get scala-ide to work that document should be updated.
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/CA%2BLiX6GxyHFA79H4s_KocH3omSzydKH_-P9GfQ5DqBKAK2cTCQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/55F6D1F8.305%40antoras.de.
I had not checked the original project into git when I was having the problem so I tried to recreate the project.I created a new project and directory structure and added the Main.scala and build.sbt from above. I ran "sbt eclise" and imported the project into scala-ide. There were not problems. I was also able to run the project from scala-ide.One small issue was when creating the Run Configuration when I browsed for the main class the browse dialog did not show my Main.scala with the main() method. Entering the fully qualified class name worked.
object Test {
def main(args: Array[String]){
println("Hello world!")
}
}
Dear Scale IDE Team,
I also just started with Scala and Scala IDE and must say it is rather bumy ;-) I run into the same error outlined above. The issue that you just get the not very helpful error message "Scala Compiler Error" is easy to reproduce. Another issue with Scala IDE is that the download page (http://scala-ide.org/download/sdk.html) says Scala IDE does include Scala 2.11.7, while it doesn't seem to include any scala (at least I cannot find scala.exe but it might also be that this is somehow hidden and the only issue is the one described below). Yet another issue is that the Scala 2.11.7 setup does not update the PATH environment variable although it says it would.
Now the sequence to reproduce the "Error in Scala compiler" issue:
--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/76eb9dab-3b99-479c-86c9-b2c9d954e994%40googlegroups.com.
Hey Michael,
Welcome to the Scala IDE mailing list!
On Wed, Oct 21, 2015 at 5:49 PM, Michael Soegtrop <michael....@intel.com> wrote:
Dear Scale IDE Team,I also just started with Scala and Scala IDE and must say it is rather bumy ;-) I run into the same error outlined above. The issue that you just get the not very helpful error message "Scala Compiler Error" is easy to reproduce. Another issue with Scala IDE is that the download page (http://scala-ide.org/download/sdk.html) says Scala IDE does include Scala 2.11.7, while it doesn't seem to include any scala (at least I cannot find scala.exe but it might also be that this is somehow hidden and the only issue is the one described below). Yet another issue is that the Scala 2.11.7 setup does not update the PATH environment variable although it says it would.
That’s wrong. Can you point us to where it says that, so we can fix it? Scala IDE comes with Scala in the same way that Eclipse come with Java: you can start coding and run Scala applications right away. But neither one nor the other does install a scalac or javac on your system, nor updates your PATH. It’s all jars, anyway :)
Now the sequence to reproduce the "Error in Scala compiler" issue:- Create New Scala Project- Project Name = Test- Use project folder as root for source and class files (if default option is used it works!)
You might be the first person to try that! :) Thanks for the bug report, it’s probably a corner case we haven’t stepped on yet. In the mean-time, please use a separate source folder, it’s good practice and most Scala projects follow Java conventions (src/ or src/main/scala).
iulian
That’s wrong. Can you point us to where it says that, so we can fix it? Scala IDE comes with Scala in the same way that Eclipse come with Java: you can start coding and run Scala applications right away. But neither one nor the other does install a
scalacorjavacon your system, nor updates your PATH. It’s all jars, anyway :)
- Create New Scala Project- Project Name = Test- Use project folder as root for source and class files (if default option is used it works!)You might be the first person to try that! :) Thanks for the bug report, it’s probably a corner case we haven’t stepped on yet. In the mean-time, please use a separate source folder, it’s good practice and most Scala projects follow Java conventions (
src/orsrc/main/scala).
import swing._
object HelloWorldGUI extends SimpleSwingApplication{
def top = new MainFrame {
contents = new Label("Hello world!")
}
}
As a beginner I wonder why console scala can figure out what to run here, but Scala IDE can't? Maybe a "Very first steps with Scala IDE" document would help.
Best regards,
Michael
Dear Iulian,That’s wrong. Can you point us to where it says that, so we can fix it? Scala IDE comes with Scala in the same way that Eclipse come with Java: you can start coding and run Scala applications right away. But neither one nor the other does install a
scalacorjavacon your system, nor updates your PATH. It’s all jars, anyway :)The page http://scala-ide.org/download/sdk.html mentions:Content
- Eclipse 4.4.2 (Luna)
- Scala IDE 4.2.0
- Scala 2.11.7 and Scala 2.10.5
- Sbt 0.13.8
- Create New Scala Project- Project Name = Test- Use project folder as root for source and class files (if default option is used it works!)You might be the first person to try that! :) Thanks for the bug report, it’s probably a corner case we haven’t stepped on yet. In the mean-time, please use a separate source folder, it’s good practice and most Scala projects follow Java conventions (
src/orsrc/main/scala).Possibly only beginners fall into this trap. I thought for a hello world app I don't need a folder structure.One more thing which is not easy to understand for beginners are the run configurations. I work a lot with eclipse in all variants (java tp embedded cross C) and understand the concept, but for the scala beginner it is not easy to guess the main class. Some hello world apps run fine with console scalac, but not with Scala IDE. For example:import swing._
object HelloWorldGUI extends SimpleSwingApplication{
def top = new MainFrame {
contents = new Label("Hello world!")
}
}
As a beginner I wonder why console scala can figure out what to run here, but Scala IDE can't? Maybe a "Very first steps with Scala IDE" document would help.
Best regards,
Michael
--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/9fb283b3-eb8f-470f-9146-7135b98f0887%40googlegroups.com.
Content
- Eclipse 4.4.2 (Luna)
- Scala IDE 4.2.0
- Scala 2.11.7 and Scala 2.10.5
- Sbt 0.13.8
Oh, ok. So nothing about the PATH variable being set. Ok, we can maybe word it better (neither does Sbt appear on you PATH after downloading Eclipse, there's no installation step at all, it's just unzipping an archive).
Content
- Eclipse 4.4.2 (Luna)
- Scala IDE 4.2.0
- Scala 2.11.7 and Scala 2.10.5
- Sbt 0.13.8
Oh, ok. So nothing about the PATH variable being set. Ok, we can maybe word it better (neither does Sbt appear on you PATH after downloading Eclipse, there's no installation step at all, it's just unzipping an archive).This was in the setup of scala itself. There is an installation module called "Update System PATH", but it doesn't update the system path.
I just mentioned it here to show how my first day with scala went:
- Install Scala IDE, make a hello world project from the tutorials => "Scala Compiler Error"
- Hmm might be that there is no compiler => Install command line scala => "Scala Compiler Error"
- Does the scala work from command line => no, not in path
- Add scala to path => works from command line
- Try Scala IDE => "Scala Compiler Error"
- 2 hours of googling => might be some issue with pathes => Create new project wih src folder =>
- Works :-)
- Try swing based hello world app => Compiles, although IDE shows errors => Doesn't run cause of missing main class
That's what I meant by "a bit bumpy".
Best regards,
Michael
--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/ac05ce7d-858c-4c92-979e-58aaa2b396b0%40googlegroups.com.
You should have read the error message better. It should have told you what is wrong.
- Install Scala IDE, make a hello world project from the tutorials => "Scala Compiler Error"
"Error in Scala compiler"java.lang.NullPointerExceptionat org.scalaide.core.internal.builder.zinc.SbtInputs$$anon$2$$anonfun$classpath$1.apply(SbtInputs.scala:78)at org.scalaide.core.internal.builder.zinc.SbtInputs$$anon$2$$anonfun$classpath$1.apply(SbtInputs.scala:78)at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
--
Best regards,
Michael
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/ee3d4f85-5d49-44ed-bd4f-4de27c0df26c%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/ee3d4f85-5d49-44ed-bd4f-4de27c0df26c%40googlegroups.com.
Dear Simon,
You can help us by showing us the full stack traces. Based on the one above, I at least could improve the error message that would be shown in your case. The problem is still not fixed since I do not know how to reproduce the problem. If you can remember the steps you did that led you to the problem it would be very helpful to us if you would report them back.
The full stack trace as well as detailed instructions for reproducing the problem are in my first post on this topic (from October 21). In short: create a hello world project and tick the option to not create separate source folders.
Best regards,
Michael
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Prof. Dr. Hermann Eul
Chairperson of the Supervisory Board: Tiffany Doon Silva
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
Dear Iulian,
I had worked on a "Cheat Sheet" and intro page for Scala IDE, which would pop up as the first thing when you install the plugin (the full page with links to tutorials) and a couple of small tutorials:
It is way hard to follow from the git post;-) I think what would be most useful is a list of caveats for those who are following other Scala tutorials with Scale IDE. The pitfalls I got into as yet:
· The issue with the separate source paths discussed above. If this option cannot be removed, document it in a place that cannot be overlooked and try to improve the error message.
· It is way non obvious why command line scala doesn’t need to know a main object, but Scala IDE needs to know to run something. It is even less obvious (for beginners) what this main class might be in some cases. For some swing based hello world apps (see below) I still didn’t figure out how to run them with Scala IDE. The whole run configuration topic definitely needs some documentation for beginners. I would even think the run configurations are a bit abused in Scala IDE. Simple apps which don’t require command line arguments or other special settings should run without providing a run configuration in the same way they run with command line Scala. At least this is the behavior of Eclipse I am used to from other languages. The only environment I have seen up to now which always requires a run configuration is embedded cross C, but there the reason why this is needed is obvious.
· Swing based trivial apps compile (as far as I can tell), but the IDE shows a lot of unknown symbol errors.
Below is an example swing based hello world app from some Scala tutorial. This compiles and runs fine with command line Scala but shows an error in pretty much every line in Scala IDE. As far as I can tell it compiles fine with Scala IDE but I couldn’t figure out the main class for the run configuration.
Best regards,
Michael
import swing._
object HelloWorld_GUI extends SimpleSwingApplication {
def top = new MainFrame {
contents = new Label("Hello world!")
}
}
Intel Deutschland GmbH
Dear Iulian,
I had worked on a "Cheat Sheet" and intro page for Scala IDE, which would pop up as the first thing when you install the plugin (the full page with links to tutorials) and a couple of small tutorials:
It is way hard to follow from the git post;-) I think what would be most useful is a list of caveats for those who are following other Scala tutorials with Scale IDE. The pitfalls I got into as yet:
· The issue with the separate source paths discussed above. If this option cannot be removed, document it in a place that cannot be overlooked and try to improve the error message.
· It is way non obvious why command line scala doesn’t need to know a main object, but Scala IDE needs to know to run something. It is even less obvious (for beginners) what this main class might be in some cases. For some swing based hello world apps (see below) I still didn’t figure out how to run them with Scala IDE. The whole run configuration topic definitely needs some documentation for beginners. I would even think the run configurations are a bit abused in Scala IDE. Simple apps which don’t require command line arguments or other special settings should run without providing a run configuration in the same way they run with command line Scala. At least this is the behavior of Eclipse I am used to from other languages. The only environment I have seen up to now which always requires a run configuration is embedded cross C, but there the reason why this is needed is obvious.
· Swing based trivial apps compile (as far as I can tell), but the IDE shows a lot of unknown symbol errors.
Below is an example swing based hello world app from some Scala tutorial. This compiles and runs fine with command line Scala but shows an error in pretty much every line in Scala IDE. As far as I can tell it compiles fine with Scala IDE but I couldn’t figure out the main class for the run configuration.
Best regards,
Michael
import swing._
object HelloWorld_GUI extends SimpleSwingApplication {
def top = new MainFrame {
contents = new Label("Hello world!")
}
}
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Prof. Dr. Hermann Eul
Chairperson of the Supervisory Board: Tiffany Doon Silva
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/0F7D3B1B3C4B894D824F5B822E3E5A172CE3367D%40IRSMSX102.ger.corp.intel.com.
Dear Iulian,
It is way hard to follow from the git post;-) I think what would be most useful is a list of caveats for those who are following other Scala tutorials with Scale IDE. The pitfalls I got into as yet:
I'm not sure if this is ironic or not... that commit is adding a "tutorial" like feature in Eclipse, some sort of interactive help where the user is guided through the first steps using a new feature. This is the Eclipse help for this meta-feature, but it's not very clear.
Sorry I was unclear. For sure the eclipse cheat sheet is a good idea! But since it is not yet in, I read your material as it appears on github.
· It is way non obvious why command line scala doesn’t need to know a main object, but Scala IDE needs to know to run something. It is even less obvious (for beginners) what this main class might be in some cases. For some swing based hello world apps (see below) I still didn’t figure out how to run them with Scala IDE. The whole run configuration topic definitely needs some documentation for beginners. I would even think the run configurations are a bit abused in Scala IDE. Simple apps which don’t require command line arguments or other special settings should run without providing a run configuration in the same way they run with command line Scala. At least this is the behavior of Eclipse I am used to from other languages. The only environment I have seen up to now which always requires a run configuration is embedded cross C, but there the reason why this is needed is obvious.
This could be a bug, normally "right-click" and Run As Scala Application works just fine. I use it every day. So, ideally, we should be able to reproduce your problem and fix it. Of course, if the project has errors, this won't probably work.
I guess what confused me is that the project itself only has a “Run as Java Application” entry. When you select this, you get an error “Selection does not contain a main type”. So after some messing around I created a run configuration where I specify the main object. The “Run as Scala Application” menu entry only exists for individual Scala files, not the project. This is confusing because the application should be represented by the project, and not by an individual file. I am not sure I understand the semantics of “Run as Scala Application” for a single file. Would that have different effects if I select different Scala files from the same project? I guess people would be less confused, if the project would have a “Run as Scala App” menu entry.
· Swing based trivial apps compile (as far as I can tell), but the IDE shows a lot of unknown symbol errors.
Swing is an odd place to start with Scala, what kind of tutorial are you following? Swing used to be part of Scala in the early days, but since 2 years ago it was removed from the Standard library, so Eclipse won't include it in the default classpath. It seems the command line version still does, so maybe we can revisit this decision. However, what tutorial are you following?
Good to know. I was following a German Scala Tutorial, which has this on the first hello world page, directly after install: http://www.scalatutorial.de/topic148.html. Possibly the tutorial it was a bad choice.
Best regards,
Michael