New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
extract_tables() error: java.lang.NoSuchMethodError #42
Comments
traceback()
7: stop(list(message = "java.lang.NoSuchMethodError: java.lang.Integer.compare(II)I",
call = .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod",
cl, .jcast(if (inherits(o, "jobjRef") || inherits(o,
"jarrayRef")) o else cl, "java/lang/Object"), .jnew("java/lang/String",
method), j_p, j_pc, use.true.class = TRUE, evalString = simplify,
evalArray = FALSE), jobj = <S4 object of class "jobjRef">))
6: .Call(RJavaCheckExceptions, silent)
5: .jcheck(silent = FALSE)
4: .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,
.jcast(if (inherits(o, "jobjRef") || inherits(o, "jarrayRef")) o else cl,
"java/lang/Object"), .jnew("java/lang/String", method),
j_p, j_pc, use.true.class = TRUE, evalString = simplify,
evalArray = FALSE)
3: .jrcall(x, name, ...)
2: spreadsheetExtractor$isTabular(page)
1: extract_tables(f) sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: macOS Sierra 10.12.3
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] tabulizer_0.1.24 ghit_0.2.17 stringr_1.1.0 lubridate_1.6.0 forcats_0.2.0 scales_0.4.1
[7] readxl_0.1.1 dplyr_0.5.0 purrr_0.2.2 readr_1.0.0 tidyr_0.6.1 tibble_1.2
[13] ggplot2_2.2.1 tidyverse_1.1.1 knitr_1.15.1
loaded via a namespace (and not attached):
[1] Rcpp_0.12.9 git2r_0.18.0 plyr_1.8.4 tools_3.3.2 jsonlite_1.3
[6] evaluate_0.10 nlme_3.1-128 gtable_0.2.0 lattice_0.20-34 png_0.1-7
[11] psych_1.6.12 DBI_0.5-1 parallel_3.3.2 haven_1.0.0 rJava_0.9-8
[16] httr_1.2.1 xml2_1.1.1 hms_0.3 grid_3.3.2 R6_2.2.0
[21] foreign_0.8-67 reshape2_1.4.2 modelr_0.1.0 magrittr_1.5 tabulizerjars_0.9.2
[26] assertthat_0.1 mnormt_1.5-5 rvest_0.3.2 colorspace_1.3-2 stringi_1.1.2
[31] lazyeval_0.2.0 munsell_0.4.3 broom_0.4.2 |
I'm facing the same issue on the same setup as @jzadra. Any thoughts on how to address this is greatly appreciated! |
Having the same issue here! |
@soedr @jrcunning Are you also on Mac? Versions? |
Yes, on Mac. I also installed the legacy java using the same link as @jzadra. Here is my Session Info:
|
@jrcunning Thanks. Can you tell me what version of Java you installed? (The underlying java library - tabula - has some updates and it looks like they're causing Mac-specific issues.) |
@leeper Yes, on Mac. Followed same procedure as @jzadra and @jrcunning. Session info:
|
Java SE 6 |
Facing the same issue. Would appreciate help. |
It seems the latest version of the tabula library is likely the issue. Consider re-installing an older version of tabulizerjars with, for example: ghit::install_github("ropensci/tabulizerjars@v0.9.0", verbose = TRUE) |
I installed tabulizerjarms v0.9.0 but still getting the same error:
|
Hey @leeper, tabula author here. Would love to help sorting this issue out, as the latest versions have significant perfomance and accuracy improvements. Would it be possible to get a code snippet that reproduces the issue? Thanks. |
I have the same problem. Version
Code from ?extract_files
Traceback
Thank you |
Version
Code
Reply
traceback()
|
@leeper I'm quite sure that this only happens in Java 6. |
Tabula-0.9.2.jar renders the same error as generated by tabulizer when Java 6 is the default JRE (see below). This is solved when switching to Java 8; unfortunately this does not make tabulizer work.
|
@jkeuskamp Can you run |
It is indeed Java 6:
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-468-11M4833)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-468, mixed mode)
|
Thanks @jkeuskamp. Can't help you much about tabulizer, but tabula itself will work under a newer version of the Java virtual machine (7 or 8). Bear in mind that Java 6 has stopped receiving updates and support since 2013. I'd recommend that you update your Java installation and try again. |
@leeper @jzadra @jazzido to make tabulizer use JVM 8, edit the file ~/.profile and set the following env variables:
then restart macOS or set the variables manually and restart RStudio. |
After trying the fix that solved things for jkeuskamp, I unfortunately still receive the "java.lang.NoSuchMethodError: java.lang.Integer.compare(II)I" error. > sessionInfo()
R version 3.3.3 (2017-03-06)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: macOS Sierra 10.12.4
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] tabulizer_0.1.24 rJava_0.9-8 tidyr_0.6.1 magrittr_1.5 dplyr_0.5.0
loaded via a namespace (and not attached):
[1] tabulizerjars_0.9.2 R6_2.2.0 assertthat_0.2.0 DBI_0.6-1
[5] tools_3.3.3 tibble_1.3.0 Rcpp_0.12.10 git2r_0.18.0
[9] ghit_0.2.17 png_0.1-7
> traceback()
7: stop(list(message = "java.lang.NoSuchMethodError: java.lang.Integer.compare(II)I",
call = .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod",
cl, .jcast(if (inherits(o, "jobjRef") || inherits(o,
"jarrayRef")) o else cl, "java/lang/Object"), .jnew("java/lang/String",
method), j_p, j_pc, use.true.class = TRUE, evalString = simplify,
evalArray = FALSE), jobj = <S4 object of class "jobjRef">))
6: .Call(RJavaCheckExceptions, silent)
5: .jcheck(silent = FALSE)
4: .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,
.jcast(if (inherits(o, "jobjRef") || inherits(o, "jarrayRef")) o else cl,
"java/lang/Object"), .jnew("java/lang/String", method),
j_p, j_pc, use.true.class = TRUE, evalString = simplify,
evalArray = FALSE)
3: .jrcall(x, name, ...)
2: spreadsheetExtractor$isTabular(page)
1: extract_tables(f2, pages = 2) |
@supermdat could you confirm that java 8 is indeed called from R?
this should return someting like
The second number tells you whether java 6/7/8 is called. |
Thanks very much, @jkeuskamp . That is indeed the difference. Running java -version from terminal gives:
However, running this from within RStudio gives:
I've done some searching but don't understand well how to have R call Java 8. I'll continue researching, but would appreciate any tips. |
@leeper Just noticed that the README.Rmd mentions:
You probably want to remove this line, as tabulizer now requires Java 7/8 |
Found similar issue on rJava GitHub Managed to force rJava to use 1.8 by running If you run into issues then loading rJava with something similar to you then need to link the files together using: source And finally, it should load and show 1.8, which on my system meant I could run tabulizer successfully(!), |
Hi all, Would there be any way at all of getting tabulizer to work with Java 6? I'm having the above NoSuchMethodError issue but on Windows with Java 6 installed (unfortunately can't update Java very easily as it's a work computer without admin rights) Perhaps an older version of tabulizer and/or tabulizerjars? Thanks for any help anyone can offer! |
@peterblair You can definitely try pulling an older version of tabulizerjars; the versions are all available as releases on GitHub and they are numbered to align with tabula-java release numbers, e.g.: |
Just for info, installing tabulizerjars v0.8.0 works with Java 6 on Windows. Thanks very much! |
I've just installed tabulizer from github. I'm using MacOS Sierra. I also installed the legacy java from the link given on the install instructions: https://support.apple.com/kb/DL1572?locale=en_US.
When I use
extract_tables()
, I get the following error:The text was updated successfully, but these errors were encountered: