2

As soon as I execute jython binary, I get the following error:

Traceback (most recent call last):
  File "/opt/jython2.7.0/bin/jython", line 444, in <module>
    main(sys.argv)
  File "/opt/jython2.7.0/bin/jython", line 431, in main
    os.execvp(command[0], command[1:])
  File "/usr/lib/python2.7/os.py", line 346, in execvp
    _execvpe(file, args)
  File "/usr/lib/python2.7/os.py", line 370, in _execvpe
    func(file, *argrest)
OSError: [Errno 2] No such file or directory

It is not clear for me which file is missing here, but what is stranger is that it can be executed from Eclipse with no problems.

Any idea? I'm a bit lost here

1 Answer 1

2

Check your JAVA_HOME environment variable. Mine was pointing to a non-existing Java installation.

Broken:

$ export JAVA_HOME=bad path
$ jython2.7.0/bin/jython
Traceback (most recent call last):
  File "jython2.7.0/bin/jython", line 444, in <module>
    main(sys.argv)
  File "jython2.7.0/bin/jython", line 431, in main
    os.execvp(command[0], command[1:])
  File "/usr/lib/python2.7/os.py", line 346, in execvp
    _execvpe(file, args)
  File "/usr/lib/python2.7/os.py", line 370, in _execvpe
    func(file, *argrest)
OSError: [Errno 2] No such file or directory

Fixed:

$ export JAVA_HOME=$HOME/java/jdk1.8.0_121
$ jython2.7.0/bin/jython
Jython 2.7.0 (default:9987c746f838, Apr 29 2015, 02:25:11) 
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_121
Type "help", "copyright", "credits" or "license" for more information.
Sign up to request clarification or add additional context in comments.

1 Comment

indeed, in my case it was JAVA_HOME and JRE_HOME set wrong

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.