USING Py4J


In [1]:
import py4j
from py4j.java_gateway import JavaGateway


---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-4ed1362342cd> in <module>()
----> 1 import py4j
      2 from py4j.java_gateway import JavaGateway

ImportError: No module named 'py4j'

In [2]:
gateway = JavaGateway()
gateway.jvm


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-2-ddcba3bbc6a8> in <module>()
----> 1 gateway = JavaGateway()
      2 gateway.jvm

NameError: name 'JavaGateway' is not defined

Using command line


In [3]:
import os

In [4]:
os.system("java -jar ../java/extractText.jar ../data/ExampleTest.pdf" )


Out[4]:
256

In [6]:
os.system("java -jar ../java/extractText.jar /home/oier/Desktop/informe_9370208.pdf")


Out[6]:
0

In [5]:
os.system("java -jar ../java/extractText.jar '/home/oier/Dropbox (Neurita)/Oier Etxaniz/docs peticion de beca UPV 2015/resumen.pdf'")


Out[5]:
0

In [6]:
os.system("java -jar ../java/extractText.jar /home/oier/Dropbox\ \(Neurita\)/Cancer/cun/informe_9469158.pdf")


Out[6]:
0

In [ ]: