Note that there are some explanatory texts on larger screens.

plurals
  1. POScala REPL only runs as root user, gives error when run as non-root
    text
    copied!<p>I'm running 64-bit OpenSUSE 12.1, today I downloaded the latest Scala 2.9.2 from the official website, after unpacking the tgz and go to scala-2.9.2/bin directory, I executed "scala" and got this error message:</p> <pre><code>[init] error: error while loading &lt;root&gt;, error in opening zip file Failed to initialize compiler: object scala not found. ** Note that as of 2.8 scala does not assume use of the java classpath. ** For the old behavior pass -usejavacp to scala, or if using a Settings ** object programatically, settings.usejavacp.value = true. </code></pre> <p>I attempted to run scala -usejavacp but it doesn't help. I've been using Scala a lot in many other distros and have never got this error before.</p> <p>My OpenSUSE installation has OpenJDK 6 installed.</p> <p>Please suggest your opinions, thank you!</p> <p>I have made the following attempts to solve the problem:</p> <ol> <li>Install Oracle JDK 1.7 and run scala, confirmed that scala REPL reports running in hotspot JVM 1.7, same error occurs.</li> <li>Installed sbt and run "console" from sbt, same error occurs.</li> <li>strace and diff the output between sudo scala and scala as normal user, there is no difference except the error message above.</li> <li>scala -Ylog-classpath as su and normal user, then diff the output, same as above.</li> <li>disabled AppArmor and tried again, same error message.</li> <li>Download other scala versions (all of 2.9x, and 2.10 milestone 4), all of their REPL give the same error message.</li> <li>Made sure fsc is not running before scala REPL runs</li> <li>Made sure that the hostname is resolvable</li> </ol> <p>well this is a really interesting problem, I'll definitely post a solution if I can luckily find it.</p> <p>Thanks a lot for your help!</p> <p>Last edit: Thanks for everyone here and on reddit (http://www.reddit.com/r/scala/comments/w5s0m/please_help_scala_only_runs_as_root_user_gives/) who offered very valuable suggestions to help me figure out this very strange issue. See my answer below for the solution.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload