0
votes

Following the "https://www.coursera.org/learn/scala-spark-big-data/supplement/R7FJ9/eclipse-tutorial" course, I'm trying to create a eclipse project from sbt, by adding sbteclipse plugin.

sbt new scala/hello-world.g8

cd hello-world

echo 'addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.1.0")' > project/plugins.sbt

sbt> eclipse

It should last a minute and return several successful, but instead it stay still, it gets stuck. The message I've received is

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0

I've installed sbt 1.0.2, it fails, then I'd install sbt 0.13.16 and still fails. Checking the sbt version it says it's 1.0.2 (although I'd uninstalled sbt 1.0.2 to install the older version).

checking https://github.com/typesafehub/sbteclipse/issues/346 it seen like this is a brand new issue, it's supose the gets fix by typing sbt.version=0.13.16 in project/build.properties, but even after that the problem persist. I don't know if problem persist because is a fix for Mac and I'm working on windows 10, or if the solution saids is for sbt.version=0.13.15 and I'm using sbt.version=0.13.16.

Checking the \scala hello world\hello-world\eclipse file it says:

[error] [C:\Users\israel.rodriguez\Documents\eclipse\scala hello world\hello-world\project\plugins.sbt]:1: unclosed character literal

Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? Terminate batch job (Y/N)?

checking the \scala hello world\hello-world\project\plugins.sbt I found :

'addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.1.0")'

when removing the ' ' at the beginning and the end. the \scala hello world\hello-world\eclipse file saids :

[info] Loading project definition from C:\Users\israel.rodriguez\Documents\eclipse\scala hello world\hello-world\project

[info] Set current project to hello-world (in build file:/C:/Users/israel.rodriguez/Documents/eclipse/scala%20hello%20world/hello-world/)

and it remain there for eternity. with the same message on windows shell :

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0

My question is, what's wrong over here? ,and how can I solve or work around this. Sorry for the rookie question, is my firt time with sbt, scala or spark.

3
It looks like the bug is in the sbt eclipse version. Are you running the sbt eclipse version with the bugfix?Ben McNiel
In addition to updating your plugin version (which looks like it will fix it), you can also turn up logging to get a better idea of what's going on by executing set logLevel := Level.Debug from the shell.Shane Perry

3 Answers

4
votes

I was in exact same scenario with the same problem as mentioned above. Here is how I overcame it.

Firstly there is no problem in steps that you follow everything is correct except:

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.1.0")

Use latest version for the sbt plugin form, which is:

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.4")

The latest version handles the hanging console problem as described here, also there is no need to use '' at the beginning and the end.

Step: 1. Download and install sbt from here (windows sbt-1.0.4.msi)

Step 2. Go to cmd prompt and type sbt about, it will display something like this

C:\Users\rajnish.kumar>sbt about
"C:\Users\rajnish.kumar\.sbt\preloaded\org.scala-sbt\sbt\"1.0.4"\jars\sbt.jar"
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[warn] Executing in batch mode.
[warn]   For better performance, hit [ENTER] to switch to interactive mode, or
[warn]   consider launching sbt without any commands, or explicitly passing 'shell'
[info] Loading project definition from C:\Users\rajnish.kumar\project
[info] Set current project to rajnish-kumar (in build file:/C:/Users/rajnish.kumar/)
[info] This is sbt 0.13.15
[info] The current project is {file:/C:/Users/rajnish.kumar/}rajnish-kumar 0.1-SNAPSHOT
[info] The current project is built against Scala 2.10.6
[info] Available Plugins: sbt.plugins.IvyPlugin, sbt.plugins.JvmPlugin, sbt.plugins.CorePlugin, sbt.plugins.JUnitXmlReportPlugin, sbt.plugins.Giter8TemplatePlugin
[info] sbt, sbt plugins, and build definitions are using Scala 2.10.6

I'm not sure why it says "This is sbt 0.13.15"; if anybody knows please answer it here.

Step 3. Go to your workspace form cmd prompt and type and hit sbt new sbt/scala-seed.g8, type project name as (e.g. hello) when asked.

Step 4. Now move to your project directory i.e cd hello

Step 5. Now type echo addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.4") > project/plugins.sbt

Step 6. Make sure you are inside the hello project and then instead of calling sbt > eclipse (if you will do like this way then it will get stuck in the same infinite loop as you're getting) only call sbt and it will start the server on default port.

Step 7. Now type eclipse, now it will start downloading all dependency, eventually it will show Successfully created Eclipse project files for project(s):

Step 8. Import project (hello) to Eclipse as normal and it will work. Please not do not call sbt > eclipse in single go call them one by one first call sbt and when server is started then only call Eclipse.

0
votes

I had the same issue when I start reading about scala. Concerning the problem of [\plugins.sbt]:1: unclosed character literal] use :

echo addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.1.0") > project/plugins.sbt

Remove the simple quote from the begining and the end of the echo first parameter

0
votes

I had the very same issue as you describe. I use Windows 10 and wonder if it just occurs on that system.

It works if I use sbteclipse 5.2.4 and some other small modifications:

cd hello-world

echo 'addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.4")' > project/plugins.sbt

Next, I need to go to project/plugins.sbt and remove the ' at the beginning and end of the line.

Now, do NOT enter sbt > eclipse! This will just pipe the sbt console into a the newly created file and you won't execute eclipse. Instead, typ the following into the command line:

sbt eclipse