Skip to content

Commit

Permalink
Installation details
Browse files Browse the repository at this point in the history
Added more details around the installation and configuration process.
Fixed that engine no longer logs "Activated scripting support..."

Signed-off-by: Mark Theiding <mark.theiding@gmail.com>
  • Loading branch information
theiding committed Apr 18, 2020
1 parent 6da090f commit f4c260f
Showing 1 changed file with 7 additions and 9 deletions.
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

0 comments on commit f4c260f

Please sign in to comment.