0

当我运行以下命令时,我正在尝试使用 tabula-py 将 pdf 转换为表格

x=tabula.read_pdf("/Users/Rexon/PycharmProjects/UNFCCC_pdftocsv/Australia Data.pdf", output_format='Dataframe')

这是错误信息

Exception in thread "main" java.lang.UnsupportedClassVersionError: technology/tabula/CommandLineApp : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

Traceback (most recent call last):
File "<input>", line 1, in <module>  
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tabula/wrapper.py", line 75, in read_pdf
    output = subprocess.check_output(args)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 219, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
 CalledProcessError: Command '['java', '-jar', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tabula/tabula-1.0.1-jar-with-dependencies.jar', '--pages', '1', '--guess', '/Users/Rexon/PycharmProjects/UNFCCC_pdftocsv/Australia Data.pdf']' returned non-zero exit status 1
4

1 回答 1

0

根据评论,解决方案是将 Java 从 1.6 升级到 1.8。

于 2018-02-02T21:24:53.193 回答