简体   繁体   English

Ensime下标量模式

[英]Ensime inferior scala mode

I've setup Emacs + Ensime for scala. 我已经为Scala设置了Emacs + Ensime。

I'm able to start sbt console inside emacs using Cc Cv s 我可以使用Cc Cv在emacs中启动sbt控制台

If i start scala console inside emacs using Cc Cv z, I get the following error 如果我使用Cc Cv z在emacs中启动scala控制台,则会出现以下错误

Welcome to Scala version 2.9.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_33).
scala> 
Failed to initialize compiler: class scala.reflect.BeanInfo not found

What is the fix for this error? 该错误的解决方法是什么? How do i get scala console running inside Emacs? 我如何在Emacs中运行Scala控制台?

I've ran into a similar error recently, but here's how I worked around it (but I don't know how to fix it, so this is only half the answer). 我最近遇到了类似的错误,但是这是我的解决方法(但是我不知道如何解决它,所以这只是答案的一半)。 What I did was to customize the ensime-inf-default-cmd-line variable to have the value: '("sbt" "console") . 我所做的是自定义ensime-inf-default-cmd-line变量,使其具有值: '("sbt" "console") Which will indeed start the interactive Scala environment. 这确实将启动交互式Scala环境。

EDIT: 编辑:

Here's relevant parts from .emacs , but I'm not sure it will matter / will be the same in every install: 这是.emacs的相关部分,但我不确定在每次安装中都一样/是否相同:

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 ;;
 ;; more stuff ...
 ;; I'm not sure this line is correct / makes any difference
 '(ensime-inf-cmd-template (quote ("sbt" "console" "-classpath" :classpath)))
 ;; This variable is used to launch the interpreter
 '(ensime-inf-default-cmd-line (quote ("sbt" "console"))))

(require 'scala-mode2)
(add-to-list 'auto-mode-alist '("\\.scala$" . scala-mode))
(add-to-list 'load-path "~/.emacs.d/ensime/elisp/")
(require 'ensime)
(add-hook 'scala-mode-hook 'ensime-scala-mode-hook)

I've installed scala-mode2 from MELPA. 我已经从MELPA安装了scala-mode2 mode2。 Installed sbt version 0.12.0 by downloading an RPM from their site. 通过从其站点下载RPM安装了sbt版本0.12.0。 I had previously JRE and JDK installed, the active version is OpenJDK 1.7. 我以前安装了JRE和JDK,活动版本是OpenJDK 1.7。 Scala installed is 2.9.2. 安装的Scala是2.9.2。 I don't know how to identify Ensime's version :| 我不知道如何识别Ensime的版本:|

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM