Can't get Jython to run

If you don't know what Jython is, it's a Java version of the programming language Python.


When I type "python" into the Terminal, it starts Python.


Yet when I type "jython" into the Terminal, I get the following response:

new-host-2:~ My1stMac$ jython

-bash: jython: command not found

new-host-2:~ My1stMac$


I have Jython 2.7 & Python 2.7 installed.

Why does python start but jython doesn't? How do I add jython to the PATH?

Mac mini, OS X El Capitan (10.11.5)

Posted on Aug 3, 2016 12:31 PM

Reply
11 replies

Aug 10, 2016 11:32 AM in response to macnerd48

This is ordinarily a very responsive support community. If anyone here is using Jython, then you would have received a timely response by now.


Your recourse is to go back to the Jython Project, or a Goog search, and get help from those sources. Or, you could use the real Python.org Python that is installed by OS X. 😉


It would appear that where you installed Jython is not in your default search path, as is the System Python. Find where you installed Jython, and then using a real editor, append that full path to your PATH environment variable in your ~/homedir/.bashrc, or ~/homedir/.bash_login file. Take note of any other environment variable settings that are unique to Jython.Then source .bashrc or .bash_login to make that PATH change current.


Once you have done that, you should be able to enter Jython on the command-line and it will be found — providing all other Jython dependencies are met. Read further in the Jython docs about how to aim it at your Jython library.

Aug 10, 2016 5:30 PM in response to etresoft

It would appear that where you installed Jython is not in your default search path, as is the System Python. Find where you installed Jython, and then using a real editor, append that full path to your PATH environment variable in your ~/homedir/.bashrc, or ~/homedir/.bash_login file. Take note of any other environment variable settings that are unique to Jython.Then source .bashrc or .bash_login to make that PATH change current.

HUH?


I downloaded a JAR file from jython.org & ran it & it installed jython.


I searched for .bashrc and .bash_login & Finder couldn't find either of them.


I avoid using the Terminal unless I have to. I have no idea what you are referring to. What's a "real editor"? What does "Then source .bashrc or .bash_login to make that PATH change current." mean?

Aug 11, 2016 5:17 AM in response to etresoft

I've installed the JDK & Netbeans & Intellij.


It occurred to me that I really don't need to use the Terminal. Besides, if I want to learn Jython, all I need to do is type in "python" at the Terminal prompt because Jython is a Java implementation of Python. Netbeans supports Jython & Intellij supports kotlin. So, I can use the IDEs to learn Jython or kotlin.

Aug 11, 2016 6:11 AM in response to macnerd48

If you had no intention of using/learning the command-line in the Terminal, why did you ask for help in determining its PATH configuration? Both Etresoft and I responded in that capacity.


Now stipulating that you will do all your development learning in those two IDE with Jython invalidates your original post question, and has wasted your time and ours.


Etresoft and I are always glad to help those that are not chasing their own tail.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Can't get Jython to run

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.