4

I have some trouble after installing java 1.8 on Ubuntu Gnome 14.04 with Intellij Idea 13.1.

When I tried to import sbt project it throws next:

enter image description here

I tried to install and set up java 1.7 at .pam-environment. But it keep taking 1.8 as main configuration and throwing this warning. I solved it by completely delete 1.8 version.

Version of scala:

nazar@lelyak-desktop:~⟫ scala -version
Scala code runner version 2.10.4 -- Copyright 2002-2013, LAMP/EPFL

And sbt - 0.13.1

I wondering to know how to use sbt with JDK 1.8?

Or with let sbt to use 1.7 version when 1.8 is default.

SOLUTION:

I changed configuration at settings for sbt to custom JDK - 1.7 and sbt-launch.jar - have installed by me.

catch23
  • 17,519
  • 42
  • 144
  • 217
  • You seem to have [this problem](http://stackoverflow.com/questions/18842985/scala-repl-startup-error-class-file-is-broken); although there it says that with Scala 2.10 you should be fine to run on Java 8... Since you post the screen shot, this appears to be IntelliJ IDEA. Perhaps that uses an older version of sbt based on Scala 2.9? Just some guessing. – 0__ May 11 '14 at 22:14
  • @0__ At `REPL` all was working fine with 1.8. This trouble appear only at importing sbt project. – catch23 May 11 '14 at 22:23
  • You might ask on the [IntelliJ IDEA Forum](http://devnet.jetbrains.com/community/idea/scala) which sbt version they use, perhaps there lies the problem. Which IDEA version do you use? Latest is 13.1.2. You could try to use the [third party sbt plugin](https://github.com/orfjackal/idea-sbt-plugin) along with [sbt-idea](https://github.com/mpeltonen/sbt-idea) to generate IDEA project files and run the build. – 0__ May 11 '14 at 22:26

1 Answers1

1

The reason for the warning/error is that in Java 8 the permanent generation was removed.

You can change settings in IntelliJ idea not to add -XX:MaxPermSize. Go to settings page and click edit next to VM Parameters.

Settings Page

Remove parameter called -XX:MaxPermSize.

VM Parameters

lpiepiora
  • 13,659
  • 1
  • 35
  • 47
  • 2
    Actually I think the warning is the smaller problem. But on your screen shot you can see that it is possible to use a custom JVM. Maybe choosing Java 7 or Java 6 here helps? – 0__ May 11 '14 at 22:29
  • @lpiepiora Does I have to specify `MetaSpace` size? What to do if I need to use some project with earlier version of JDK (and they have PermGen)... – catch23 May 11 '14 at 22:30
  • @nazar_art so removing the `-XX:MaxPermSize` did not fix the problem, only changing the JVM for SBT? – lpiepiora May 11 '14 at 22:33
  • @0__ I have made this answer community wiki, you may edit it, if you'd like with your answer – lpiepiora May 11 '14 at 22:34