SBT won't run chisel tutorial... can't seem to find proper scala version - scala

I installed OpenJDK and then SBT on my Fedora 28 system.
SBT 1.2 comes from the bintray--sbt-rpm repository (the official one).
Both seem to work fine, and I can do basic scala projects.
Then I cloned the chisel-tutorial from the github chisel-tutorial site.
But when I go into the chisel-tutorial directory, SBT refuses to run at all, getting what appears to be an error about the scala version (which is well-nigh incomprehensible to me, but zillions of posts imply that scala version mismatch causes this message):
java.lang.NoSuchMethodError: scala.Predef$.$conforms()Lscala/Predef$$less$colon$less;
My understanding is that sbt is supposed to find the right scala version, but in my case it clearly does NOT.
I have tried dozens of things, some hinted at by posts that refer to the above error message. But they never say exactly what to do, just say something like "your problem is scala version, and that should fix it".
Surely there are chisel users who know the answer, or sbt aficionadoes who do.
Any help would be appreciated!

Related

Installation of EclipseFP on Eclipse Luna (Mac OS X Yosemite)

I'm trying to get EclipseFP (Haskell support, but the original coder stopped maintaining it last month) working on my iMac but everything seems to fail constantly. I've been debugging this for hours now and like most other Haskell stuff there isn't much decent support out there regarding the installation of such tools. I haven't even written a single line of Haskell code yet (apart from some playing around in GHC/GHCI which surprisingly did work)!
I've tried so many things already, different libraries, different solutions, different versions etc. But it seems that everything that has to do with haskell support is just one big clutter of confusion for me and nothing seems to point me in an apparent direction which bothers me since I am an experienced programmer and dealing with command line interfaces, tools and dependencies isn't unknown to me on all sort of platforms for years now.
Even the most relevant topics on StackOverflow or other knowledgebases just won't cut it regarding this topic and I'm starting to feel like dropping the entire Haskell language and just use something which does play nice with the system without such troubles since it is already such a pain in the ass to get the most basic development tools to work, let alone the coding itself...
The things I got:
Mac OSX Yosmite
GHC
GHCI
Cabal (repository)
Eclipse Luna
I've installed EclipseFP using the install instructions which worked out all great. At this point I thought it would just all work without any problems as the plugin installs just fine...
Well, that was not the case of course. I've restarted Eclipse as it requested after installing new plugins. Here is where the trouble begun..
In the following steps I would have to open the Haskell Perspective in Eclipse. Well... guess what.. there was none! After strolling the web I found out that it might have compatibility issues with the old JDK 1.6 which was installed by default on MacOSX. No worries.. I've downloaded Java JDK 1.8, set it up in Eclipse, restarted it. And there the item "Haskell perpective" showed up in the list.
After clicking that, and thinking my troubles were over (and I could finally start coding!) nothing happend! I've searched around for a while and found the Eclipse error console which until this day gives me nothing more than:
An error occurred while automatically activating bundle net.sf.eclipsefp.haskell.ui (459).
org.eclipse.e4.core.di.InjectionException: java.lang.RuntimeException: org.eclipse.core.runtime.CoreException: Plug-in net.sf.eclipsefp.haskell.ui was unable to load class net.sf.eclipsefp.haskell.ui.HaskellPerspective.
Of course I have tried solving this issue and came across some dependencies which needed to be installed using cabal (BuildWrapper, Scion-Browser and some other essentials). After doing so I still have the same problem and I have no idea where to look for. The only information I can really find are topics which are more than 3/4 years old which share 0 relevance to my exact problem.
I could paste the Java stacktrace here as well which came with the error message, but it doesn't show much useful information anyway other than just basic crashing.
I hope someone can help me because I would really like to start coding now for a change instead of wasting hours on getting my basic development framework/IDE set up.
Long story short; I'd like to code some Haskell in Eclipse but the development tools just won't install and/or work properly without any notable errors or directions to look for.

Why does "activator ui" fail with "Error: Could not find or load main class ui"?

It's Typesafe Activator 1.2.10 on Windows 7, Scala 2.11.4, sbt 0.13.7. All packages installed using .msi.
When I run activator ui I get error:
Error: Could not find or load main class ui
and nothing happens then.
It appears that you're facing permission-related problems.
I can't give you the exact steps to sort it out (as I'm on Mac OS), but you should be able to work it around by running cmd as Administrator and then executing activator ui again.
There's also the version 1.2.12 so you may have more success with it. You don't need separate installations of Scala and sbt, either, as activator is going to take care of them (that's one of the many reasons to use the tool after all).

Finding and using clojure.contrib.string

I have CounterClockwise for Eclipse and believe clojure.contrib should be installed. However, I can't seem to use it or any of the subfiles such as clojure.contrib.string. If I type as I get the following errors
If I type (require 'clojure-contrib.string) I get:
FileNotFoundException Could not locate clojure_contrib/string__init.class or clojure_contrib/string.clj on classpath: clojure.lang.RT.load (RT.java:443)
Long ago in an internet far far away Clojure had a large utility library called clojure.contrib which turned out to be rather hard to maintain, so it was broken up into many libraries, each of which uses the Clojure contributors agreement. In this process clojure.contrib.string became just clojure.string and the names of all the other projects changed and they are released independently now. Seeing references to clojure.contrib is a sign that you are looking at outdated documentation. Also watch out for tutorials that make references to installing Clojure or installing dependencies without leiningen.

Does SBT use the Fast Scala Compiler (fsc)?

Does SBT make use of fsc?
For test purposes I am compiling a 500-line program on a fairly slow Ubuntu machine (Atom N270). Three successive compile times were 77s, 66s, and 66s.
I then compiled the file with fsc from the command line. Now my times were 80s, 25s, 18s. Better! That implies to me sbt is not using fsc. Am I right? If so, why doesn't it use it?
I may try getting sbt to explicitly use fsc to compile, though I am not sure I will figure out the config. Has anyone done this?
This discussion made me realize I have been using sbt the wrong way.
Instead of (from the command line):
$ sbt compile
$ sbt test
..one should keep sbt running and treat it as the command prompt.
$ sbt
> compile
...
> test
It has the command history and even ability to dive back into OS command line. I wrote this 'answer' for others like me (coming from a Makefile mindset) that might not realize we're taking the pill all wrong. :)
(It's still slow, though.)
SBT cannot benefit from the Fast Scala Compiler when you run it interactively (with or without using its continuous build mode) because the Scala compiler classes are loaded and get "warmed up" and JIT-ed, which is the entirety of fsc's advantage.
At least for SBT 0.7.x the authors explain that it is not as fast as fsc, which caches the compiler instance (including the loaded libraries), rather than just the JITted compiler classes:
http://code.google.com/p/simple-build-tool/wiki/ChangeDetectionAndTesting
My experience also confirms that fsc is faster for full compiles, but does not automatically select what to recompile.
For SBT 0.10, I can find no docs whatsoever on this issue.
You don't need to do it anymore. Sbt has its own way now:
https://github.com/sbt/sbt/wiki/Client-server-split

What are the exact versions of stuff you have to install in order to be able to step-debug a Scala program?

How do YOU debug a Scala program?
I mean YOU as in the person posting the Answer :) Please answer only from personal experience, not from stuff you've heard or read on the Internet. You should not believe everything you read on the Internet, especially tales of complex open-source software configurations that actually work :-)
The are many Java tools which claim to support Scala in some way or another, but I have so far struck out in trying to get any one of them to actually let me set a breakpoint in Scala code and step through it. These are big, major open-source IDEs I'm talking about here.
The main problem in getting a debugger to work seems to be the "version hell" with fast-changing IDEs, Plug-Ins, JDKs, and the Scala language itself.
Hence, the more detailed re-statement of the question is appropriate: What is the exact version number of the IDE, Plug-In, JDK, Scala, and even Operating System, that you are successfully using?
My question is related to this one, but wider in scope:
How To: debug Scala code when outside of an IDE
Thanks
In our development we use IntelliJ IDEA 9.0.1 which is available by the link below:
http://www.jetbrains.com/idea/download/
with Scala plugin installed:
http://confluence.jetbrains.net/display/SCA/Getting+Started+with+IntelliJ+IDEA+Scala+Plugin
All you need is to have project with Scala sources (probably, mixed with Java or other JVM-based languages) opened. You can compile it and run as Java application, maven goal etc. or connect to the remote application if it has been run in debug mode.
See IntelliJ help for details of adjusting debug configuration.
Cheers!
Ilya
I've worked with Eclipse and the Scala plugin for it. It works somewhat ok, if you can overlook the fact that it doesn't remember the configuration for your Scala application on the next run.
I debug my Scala programs by running relevant parts of it on the REPL, as to verify what it is really doing. Other than that, the good old println or logs.
Digressing here a bit, it has been a rare thing in my life a situation where step-in debuggers were actually required -- and, then, mostly for assembler code, though languages where testing snippets of code is difficult for some reason were more likely to require it than others which weren't.
OS: xUbuntu(GNU/Linux) 9.10
JDK:
java -version
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
(which is the Java-6-sun-version, used by the xUbuntu-installer).
Eclipse: 3.5.1 Build id: 20090920-1017
Scala-Plugin 2.7.7final
Scala 2.7.7
If possible: println-Statements, because eclipse is often tricky to invoke (does not find the main class, even after complete rebuild, closing/opening project, deleting old class-Files). The latest search for a problem ended when I 'deleted all bookmarks' - suddenly I was allowed to run the program.
Curious observation: class Bruch was what I tried to run, but eclipse allways mentioned 'Bruc' and named the runtime-configuration like this. Adding and removing characters reflected in the generated name accordingly (Bruc => Bru).