JPype won't compile properly
Question: So I am having trouble compiling a very simple python script using
[JPype](http://jpype.sourceforge.net/).

My code goes like:

    
    
    from jpype import *
    startJVM(getDefaultJVMPath(), "-ea")
    java.lang.System.out.println("hello world")
    shutdownJVM()
    

and when I run it I receive an error saying:

    
    
    Traceback (most recent call last):   File "test.py", line 2, in
    <module>
        startJVM(getDefaultJVMPath(), "-ea")   File "/usr/lib/pymodules/python2.7/jpype/_core.py", line 44, in startJVM
        _jpype.startup(jvm, tuple(args), True) RuntimeError: Unable to load DLL [/usr/java/jre1.5.0_05/lib/i386/client/libjvm.so], error =
    /usr/java/jre1.5.0_05/lib/i386/client/libjvm.so: cannot open shared
    object file: No such file or directory at
    src/native/common/include/jp_platform_linux.h:45
    

I'm stuck and I really need help. Thanks!


Answer: I had the same problem

    
    
    RuntimeError: Unable to load DLL [/usr/java/jre1.5.0_05/lib/i386/client/libjvm.so], error = /usr/java/jre1.5.0_05/lib/i386/client/libjvm.so: cannot open shared object file: No such file or directory at src/native/common/include/jp_platform_linux.h:45
    

In my case wrong JAVA_HOME path was set

/profile/etc

    
    
    export JAVA_HOME
    JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64
    PATH="$JAVA_HOME/bin:$PATH"
    export PATH
    

