What's the difference between jython-standalone-2.7.0.jar and jython-2.7.0.jar

夙愿已清 提交于 2019-11-30 21:18:57

One problem I've just discovered with the same error is that the maven build 2.7.0 does not include the lib folder. This is probably a build error for the release build. I had to move up the b2 build which does properly include the lib folder in the supplied jar.

Problem maven 2.7.0 jar:
<dependency> <groupId>org.python</groupId> <artifactId>jython-standalone</artifactId> <version>2.7.0</version> </dependency>

Working maven 2.7.1b2 that includes the lib folder:
<dependency> <groupId>org.python</groupId> <artifactId>jython-standalone</artifactId> <version>2.7.1b2</version> </dependency>

NOTE: If you download the jar directly from the Jython site it does correctly include the lib folder. It's just the maven repository version.

I believe the main difference causing your issue is that the jython-standalone jar provides Lib/ (which contains site.py) while the jython jar does not.

https://github.com/scijava/jython-shaded gives a more in-depth description of the issue, as well as other issues, and provides an alternative jar to get around some issues noted in the description.

I don't have experience with scijava:jython-shaded, but I substituted it into your pom (for my setup I also had to change jdk.version to 1.7 and to JythonExample) and your example runs.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!