Reputation: 2879
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:
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
UPDATE 2
Found it.. turned out that Jython2.5.1 was mixed with a zip of modules of Jython2.5.3
Upvotes: 4
Views: 377
Reputation: 2879
Turned out that Jython2.5.1 interpreter was mixed with the zip-of-the-standard-modules of Jython2.5.3
I had the interpreter version and zip-of-standard-modules mixed-up before, but this time the interpreter had the minor version, which i didn't see comming.
Upvotes: 1