如何修复 SBT 崩溃:java.lang.NumberFormatException:对于输入字符串:“0x100”?
Posted
技术标签:
【中文标题】如何修复 SBT 崩溃:java.lang.NumberFormatException:对于输入字符串:“0x100”?【英文标题】:How to fix the SBT crash: java.lang.NumberFormatException: For input string: "0x100"? 【发布时间】:2019-10-20 19:10:01 【问题描述】:我在 Ubuntu 18.04 上并使用通常的 apt-get install sbt
安装了 sbt
,到目前为止它适用于所有项目,不知道它得到了什么版本。然后我克隆了项目https://github.com/aishfenton/Argus,不管我做什么sbt都会崩溃。
我下载并安装了最新的sbt
,但仍然出现以下崩溃:
skywalker@Zeus:~/code$ java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
skywalker@Zeus:~/code$ which sbt
/opt/dev/sbt/1.2.8/bin/sbt
skywalker@Zeus:~/code$ git clone https://github.com/aishfenton/Argus
Cloning into 'Argus'...
remote: Enumerating objects: 622, done.
remote: Total 622 (delta 0), reused 0 (delta 0), pack-reused 622
Receiving objects: 100% (622/622), 140.72 KiB | 602.00 KiB/s, done.
Resolving deltas: 100% (225/225), done.
skywalker@Zeus:~/code$ cd Argus
skywalker@Zeus:~/code/Argus$ sbt
[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)
at jline.internal.InfoCmp.parseInfoCmp(InfoCmp.java:59)
at jline.UnixTerminal.parseInfoCmp(UnixTerminal.java:233)
at jline.UnixTerminal.<init>(UnixTerminal.java:64)
at jline.UnixTerminal.<init>(UnixTerminal.java:49)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at jline.TerminalFactory.getFlavor(TerminalFactory.java:209)
at jline.TerminalFactory.create(TerminalFactory.java:100)
at jline.TerminalFactory.get(TerminalFactory.java:184)
at jline.TerminalFactory.get(TerminalFactory.java:190)
at sbt.ConsoleLogger$.ansiSupported(ConsoleLogger.scala:123)
at sbt.ConsoleLogger$.<init>(ConsoleLogger.scala:117)
at sbt.ConsoleLogger$.<clinit>(ConsoleLogger.scala)
at sbt.GlobalLogging$.initial(GlobalLogging.scala:43)
at sbt.StandardMain$.initialGlobalLogging(Main.scala:64)
at sbt.StandardMain$.initialState(Main.scala:73)
at sbt.xMain.run(Main.scala:29)
at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
at xsbt.boot.Launch$.run(Launch.scala:109)
at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
at xsbt.boot.Launch$.launch(Launch.scala:117)
at xsbt.boot.Launch$.apply(Launch.scala:18)
at xsbt.boot.Boot$.runImpl(Boot.scala:56)
at xsbt.boot.Boot$.main(Boot.scala:18)
at xsbt.boot.Boot.main(Boot.scala)
有任何解决问题的想法吗?
【问题讨论】:
【参考方案1】:执行以下操作可以解决崩溃:
export TERM=xterm-color
请务必将此位添加到您的.bashrc
我在这里找到了解决方案:https://github.com/sanori/spark-sbt/issues/4
【讨论】:
在我的情况下,我必须在使用 zsh 时将其添加到.zshrc
文件中以上是关于如何修复 SBT 崩溃:java.lang.NumberFormatException:对于输入字符串:“0x100”?的主要内容,如果未能解决你的问题,请参考以下文章
Play 项目中的简单 SBT 模块导致 Play 因未知原因而崩溃 - play 2.1