Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation details #1197

Merged
merged 1 commit into from
Apr 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions configuration/jsr223-jython.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ title: JSR223 Jython Scripting
## Configuration

[Download](https://jython.github.io/index) the Jython 2.7.0 standalone or installer package, or install through a package repository.
Newer versions are not yet supported.
Install Jython on the local filesystem and make note of the installation directory location.
Install Jython on the local filesystem into a directory of your choice.
A good installation directory is `/etc/openhab2/automation/jython`.
For the easiest installation mechanism simply download `jython-standalone-2.7.0.jar` and copy it into your installation directory. Alternatively you can execute the installer and specify your installation directory during the install.
Note that newer versions than 2.7.0 are not yet supported.

The Jython implementation will need to be added to openHAB's Java classpath.
How this is done depends on the specific installation technique and operating system.
Expand All @@ -26,6 +28,9 @@ EXTRA_JAVA_OPTS="-Xbootclasspath/a:/etc/openhab2/automation/jython/jython-standa

This will add the Jython library to the Java classpath,
set the Jython home directory and specify the initial Python path for the Jython runtime.
Specifically `bootclasspath` must point to your installation directory plus the Jython library, which is
`jython-standalone-2.7.0.jar` if you copied the jar directly or `jython.jar` if you ran the installer.
Similarly `python.home` points to your installation directory.
Python modules and packages can be installed into the `python.path` locations and imported from scripts.
Note that library modules and packages are not automatically reloaded when they change.

Expand All @@ -44,16 +49,9 @@ or viewing the `openhab.log` file directly).
You should see a log line with information similar to:

```text
... [INFO ] [s.i.GenericScriptEngineFactory:28 ] - Activated scripting support for ECMAScript
... [INFO ] [s.i.GenericScriptEngineFactory:28 ] - Activated scripting support for python
...
... [INFO ] [.a.m.s.r.i.l.ScriptFileWatcher:150 ] - Loading script 'test.py'
```

::: tip Note
ECMAScript is Javascript
:::

Look for any potentially related error messages.

To enable debug logging, use the [Karaf logging]({{base}}/administration/logging.html) commands to
Expand Down