Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set the Environment variables for Jython?

I have set the variables JYTHON_HOME to the directory where I have installed Jython and JYTHON_PATH to the bin folder, but I still get the following error when I try to run jython:

'jython' is not recognized as an internal or external command,
operable program or batch file.

Why do I get this error? The Java installation has no issues.

like image 235
Bharath Gupta Avatar asked Nov 16 '11 08:11

Bharath Gupta


People also ask

Which environment variable is used to set the Java?

The PATH environment variable (for searching the executable programs) is applicable to all applications; while CLASSPATH is used by Java only.

Do we need to set environment variables for JDK?

Java does not need any environment variables to be set. However, setting some environment variables makes some things easier. PATH If the jre/bin folder is on the path, you don't have to qualify to run the java command. If the jdk/bin folder is on the path, you don't have to qualify to run the java and javac commands.


1 Answers

I am Windows user & I have installed Jython in C:\jython2.7.0.

What I had before?

I had neither set the JYTHON_HOME environment variable nor added %JYTHON_HOME%\bin to PATH environment variable. I also got the same error as shown in the question.

How I fixed?

  • I created new environment variable named JYTHON_HOME with value C:\jython2.7.0.

You've to use your own Jython's installation folder.

enter image description here

  • Then I added %JYTHON_HOME%\bin to PATH environment variable as the below 2 image shows.

Create new PATH environment variable if it is not already there (This is rare case).

enter image description here

  • Open new Terminal and type jython, it will work. Now you can try executing simple Python statements as the below image shows.

Do not use the already opened Terminal.

enter image description here

That's it.

like image 170
hygull Avatar answered Sep 18 '22 09:09

hygull