摘要:
You embed jython and you will use some Python-Modules somewere:if you want to set the path (sys.path) in your Java-Code :public void init() { interp = new PythonInterpreter(null, new PySystemState()); PySystemState sys = Py.getSystemState(); sys.path.append(new PyString(rootPath)); sys.path.append(n 阅读全文
摘要:
String urlString = ClassLoader.getSystemClassLoader().getResource("com/my/package/MyClass.class").toString();urlString = urlString.substring(urlString.indexOf("file:"), urlString.indexOf('!'));URL url = new URL(urlString);File file = new File(url.toURI());System.out.print 阅读全文