[Jepp-users] installing issues
Brought to you by:
mrjohnson0
From: V. B. <var...@gm...> - 2013-02-21 14:30:26
|
Hello, I would like to run python from java, I've found this sample class (last part of the mail) my main goal it to make this class usable. I use ubuntu 12.04. I added the jep.jar from "/usr/local/lib/jep" to the project as an external jar in Eclipse. But when I run it it fails in this line "Main main = new Main();" with: Exception in thread "main" java.lang.UnsatisfiedLinkError: no jep in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1738) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1028) at jep.Jep.<clinit>(Jep.java:138) at Main.<init>(Main.java:16) at Main.main(Main.java:32) maybe I didn't set something properly, I've just installed python2.7.2, it works. Then I followed these instructions: https://github.com/mrj0/jep/blob/master/README.rst I used this: 'pip install jep' Furthermore, I downloaded the latest version of jep(3.1.0) from here https://sourceforge.net/projects/jepp/ too. After this I should have set the LD_LIBRARY_PATH, and LD_PRELOAD according to the jep script (It was told on: https://github.com/mrj0/jep/blob/master/README.rst). However, I have two of them (I set the second.): the two jep script: 1, in the usr/local/bin, it says: LD_LIBRARY_PATH="/usr/local/lib/python2.7/dist-packages/"; export LD_LIBRARY_PATH LD_PRELOAD="/usr/lib/libpython2.7.so"; export LD_PRELOAD 2, in the downloaded_jep_folder/build/scripts-2.7, it says: LD_LIBRARY_PATH="/usr/local/lib/python2.7/site-packages/"; export LD_LIBRARY_PATH LD_PRELOAD="/usr/local/lib/libpython2.7.a"; export LD_PRELOAD If i running the test "python setup.py test", I get the following output: running test jep runtests.py ..........................EEEE. ................ ====================================================================== ERROR: test_batch (tests.test_jdbc.TestJdbc) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/test_jdbc.py", line 16, in setUp findClass('org.sqlite.JDBC') JavaException: org/sqlite/JDBC ====================================================================== ERROR: test_datetime (tests.test_jdbc.TestJdbc) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/test_jdbc.py", line 16, in setUp findClass('org.sqlite.JDBC') JavaException: org/sqlite/JDBC ====================================================================== ERROR: test_dbapi_primitives (tests.test_jdbc.TestJdbc) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/test_jdbc.py", line 16, in setUp findClass('org.sqlite.JDBC') JavaException: org/sqlite/JDBC ====================================================================== ERROR: test_java_sql (tests.test_jdbc.TestJdbc) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/test_jdbc.py", line 16, in setUp findClass('org.sqlite.JDBC') JavaException: org/sqlite/JDBC ---------------------------------------------------------------------- Ran 47 tests in 0.049s FAILED (errors=4) That would be great if someone could help me. Thanks in advance, Balazs Varhegyi Sample class: import java.util.logging.Level; import java.util.logging.Logger; import jep.Jep; import jep.JepException; /** * * @author sganapat */ public class Main { private Jep objJep; Main() { try { objJep = new Jep(); } catch (JepException ex) { Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); } } /** * @param args * the command line arguments */ public static void main(String[] args) { System.out.println("Hello"); try { Main main = new Main(); main.executeCommand(); //main.executeScript(); } catch (JepException ex) { Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); } } /** * Executes Python Commands * * @throws JepException */ private void executeCommand() throws JepException { objJep.eval("print 'Hello Java'"); } } |