0
我在一个jar中的应用程序依赖于不同罐子中的一些库。Jython Jar依赖项导入失败
这是我的问题: 当我只导入我的主应用程序文件时,jython似乎正确加载类,但通过NoClassDefError(一个支持库jar中表示的一个)缺少类。
但是,如果我现在jar添加到classpath中的Jython再也找不到原来的进口,并且抱怨:ImportError: No module named edu
我的代码:
import sys
def setClassPath():
libDir = "/Users/gestalt/Documents/msmexplorer_git/msmexplorer/MSMExplorer/"
classPaths = [
"dist/MSMExplorer.jar"
"dist/lib/prefuse.jar" #the missing class is here, but this line causes package edu to go missing
]
for classPath in classPaths:
sys.path.append(libDir+classPath)
def runJavaClass():
from edu.stanford.folding.msmexplorer import MSMExplorer
me = MSMExplorer()
def main():
setClassPath()
runJavaClass()
if __name__ == "__main__":
main()
谢谢!
这是否需要Java标记? – 2012-08-01 06:44:31
@Duncan由于其中一些涉及jar-wrangling和java classpath问题,我认为这不是不合理 – bcr 2012-08-01 06:46:24