无法让Jython在Mac上运行

时间:2018-03-08 22:47:28

标签: python macos jython

从安装程序安装Jython。

按如下方式设置路径/Users/user/jython2.7.0/bin

尝试运行Jython时,收到以下错误。

MacBook-Pro:~ user$ jython
Traceback (most recent call last):
  File "/Users/user/jython2.7.0/bin/jython", line 444, in <module>
    main(sys.argv)
  File "/Users/user/jython2.7.0/bin/jython", line 431, in main
    os.execvp(command[0], command[1:])
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 346, in execvp
_execvpe(file, args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 370, in _execvpe
   func(file, *argrest)
OSError: [Errno 2] No such file or directory

尝试卸载通过Homebrew安装的其他软件包。但没什么好的。

Jython使用安装目录中的java -jar jython.jar命令运行。

尝试在干净的Macbook上运行,一切运行正常。

1 个答案:

答案 0 :(得分:0)

Resolved the problem by pointing JAVA_HOME to jdk1.8.0_131 rather than jdk9.0.4. Not sure why this solution works.