I already had the Jython interpreter working. But when changing from java 1.7u45 to java 8, it only runs inside the IDE.
My project uses Jython2.5.3. All standard python modules are packaged into a zip file and put on the java classpath.
Now Jython fails finding 'os' reporting:
Traceback (most recent call last): File "a.py", line 36, in <module> import b.c as c File "c.py", line 1, in <module> import os File "__pyclasspath__/os.py", line 132, in <module> ImportError: no os specific module found I compared VM settings using JVisualVM between starting my app from a command-file and from the IDE. No glaring differences.
I also changed the command file to use JDK1.8.0 (as netbeans startsup) instead JRE1.8.0
I also changed the command file to run the IDE generated .class files, instead of the production jar.
I also added the "-XDebug" to the command-file version to match the IDE settings
When checking with VisualVM:
= the JVM is exactly the same,
= the JVM arguments are exactly the (same except that Netbeans has "Xrunjdwp")
= System properties almost identical:
- 'java.library.path' is identical
- jars on the 'java.class.path' are same, although the jars are have different paths.
- But python.console.encoding=cp437 is missing in the command-file version (How does IDE introduce this one?)
- user.dir is different
I don't know what to do/check next. Hope someone has an idea. Thanks
UPDATE
Seems that the Jython internal variable 'sys.builtin_module_names' which is a set, content differs in each scenario. Outside IDE, 'nt' and 'jffi' are missing. os.py raises the exception "ImportError: no os specific module found". if the set does not contain any of
- posix
- nt
- os2
- ce
- riscos
- ibmi
UPDATE 2
Found it.. turned out that Jython2.5.1 was mixed with a zip of modules of Jython2.5.3