scala: Error occurred during initialization of VM on Ubuntu 12.04 -
i tried work easy example of scala language. installed sbt
successfully. when run sbt -h
see message sbt:
usage: sbt [options] -h | -help print message -v | -verbose runner chattier -d | -debug set sbt log level debug -no-colors disable ansi color codes -sbt-create start sbt if current directory contains no sbt project -sbt-dir <path> path global settings/plugins directory (default: ~/.sbt) -sbt-boot <path> path shared boot directory (default: ~/.sbt/boot in 0.11 series) -ivy <path> path local ivy repository (default: ~/.ivy2) -mem <integer> set memory options (default: 1536, -xms1536m -xmx1536m -xx:maxpermsize=384m -xx:reservedcodecachesize=192m) ....
but when tried run in directory scala assignments (it's coursera course) caught error:
nazar_art@nazar-desctop:~/scala/example$ sbt detected sbt version 0.12.1 starting sbt: invoke -help other options error occurred during initialization of vm not reserve enough space object heap
but should open sbt command prompt. smt this:
shell$ cd /path/to/progfun-project-directory # shell of operating system shell$ sbt > _ # sbt shell
update:
after add following line
java -xms64m -xmx256m -xss1m -xx:+cmsclassunloadingenabled -xx:maxpermsize=64m -jar
dirname $0/sbt-launch.jar "$@"
at /usr/bin
see next output:
nazar_art@nazar-desctop:/usr/bin$ sbt bash: /usr/bin/sbt: permission denied nazar_art@nazar-desctop:/usr/bin$ sudo sbt sudo: sbt: command not found
- why happen?
- how solve issue?
first of all, example folder name (and folder name have installed sbt) cannot include "!". applies other special characters well. even, recommend install sbt in folder has no space on path (and same thing examples folder).
for example, if have installed sbt (or examples folder) on path like:
/users/dashti/my programs/sbt-0.12.1
you can re-install path like:
/users/dashti/myprograms/sbt-0.12.1
by applying naming change, if error gone, please ignore rest of post.
otherwise, fix mentioned error, first find sbt executable script, edit , correct problem in it:
if using unix-based operating system, please follow these steps:
1- find sbt: open terminal , type command:
which sbt
and receive path like:
/users/dashti/documents/scala-2.10.0/bin/sbt
and in file, there command executing java program, like:
java -xms512m -xmx1024m -xss1m -xx:+cmsclassunloadingenabled -xx:maxpermsize=128m -jar `dirname $0`/sbt-launch.jar "$@"
2- edit sbt script: entering command in terminal:
vim /users/dashti/documents/scala-2.10.0/bin/sbt
you able edit file , maybe should change memory usage arguments lower specification ( should think whether have enough ram running sbt). example, 1 better choice:
java -xms64m -xmx256m -xss1m -xx:+cmsclassunloadingenabled -xx:maxpermsize=64m -jar `dirname $0`/sbt-launch.jar "$@"
Comments
Post a Comment