2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

iTermでのscala起動時エラーへの対処法

Posted at

MacのiTermでscalaを起動させたところ、下記のエラーメッセージが出てしまいました。

$ scala
Welcome to Scala 2.11.12 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_211).
Type in expressions for evaluation. Or try :help.
[ERROR] Failed to construct terminal; falling back to unsupported
java.lang.NumberFormatException: For input string: "0x100"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Integer.parseInt(Integer.java:580)
	at java.lang.Integer.valueOf(Integer.java:766)

解決法

調べたところTERM環境変数が変更すると解決するらしいです。
現在のTERMを調べてみるとxterm-256colorでした。
これをxterm-colorに変更すると無事に動くようになりました。

export TERM=xterm-color

TERMとは

ついでにTERMという環境変数について調べたところ、ユーザーが使用している端末をの種類をプログラムに伝える役目を果たしているそうです。
文字を削除したり、戻ったりなどの機能はエスケープシーケンスと呼ばれる特殊な文字の入力で伝えられるのですが、端末によってエスケープシーケンスのコードが異なるため、環境変数で指定してあげる必要があるようです。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?