Comments (28)
Found similar issue on rJava GitHub
Managed to force rJava to use 1.8 by running
R CMD javareconf JAVA_CPPFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers
then reinstalling rJava from source with
install.packages("rJava", "http://rforge.net/", type="source")
If you run into issues then loading rJava with something similar to
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rJava/libs/rJava.so':
you then need to link the files together using: source
sudo ln -f -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib
And finally, it should load and show 1.8, which on my system meant I could run tabulizer successfully(!),
from tabulapdf.
@leeper @jzadra @jazzido
This solved the issue for me:
I Installed JVM 8 and pointed RStudio to its installation as described here
to make tabulizer use JVM 8, edit the file ~/.profile and set the following env variables:
export JAVA_HOME=`/usr/libexec/java_home -v 1.8
export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/server
then restart macOS or set the variables manually and restart RStudio.
from tabulapdf.
Having the same issue here!
from tabulapdf.
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.
from tabulapdf.
Just for info, installing tabulizerjars v0.8.0 works with Java 6 on Windows. Thanks very much!
from tabulapdf.
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
from tabulapdf.
I'm facing the same issue on the same setup as @jzadra. Any thoughts on how to address this is greatly appreciated!
from tabulapdf.
@soedr @jrcunning Are you also on Mac? Versions?
from tabulapdf.
Yes, on Mac. I also installed the legacy java using the same link as @jzadra. Here is my Session Info:
R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.12.3 (Sierra)
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
loaded via a namespace (and not attached):
[1] tabulizerjars_0.9.2 tools_3.3.1 rJava_0.9-8 png_0.1-7
from tabulapdf.
@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.)
from tabulapdf.
@leeper Yes, on Mac. Followed same procedure as @jzadra and @jrcunning. Session info:
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 devtools_1.12.0
loaded via a namespace (and not attached):
[1] reshape2_1.4.2 rJava_0.9-8 haven_1.0.0 lattice_0.20-34 colorspace_1.3-2 ghit_0.2.17 foreign_0.8-67 withr_1.0.2 DBI_0.5-1
[10] modelr_0.1.0 readxl_0.1.1 plyr_1.8.4 stringr_1.1.0 munsell_0.4.3 gtable_0.2.0 rvest_0.3.2 leaps_3.0 psych_1.6.12
[19] memoise_1.0.0 labeling_0.3 knitr_1.15.1 forcats_0.2.0 parallel_3.3.2 curl_2.3 broom_0.4.2 Rcpp_0.12.9 tabulizerjars_0.9.2
[28] scales_0.4.1 flashClust_1.01-2 scatterplot3d_0.3-38 jsonlite_1.2 mnormt_1.5-5 png_0.1-7 hms_0.3 digest_0.6.12 stringi_1.1.2
[37] grid_3.3.2 tools_3.3.2 magrittr_1.5 lazyeval_0.2.0 cluster_2.0.5 crayon_1.3.2 MASS_7.3-45 xml2_1.1.0 lubridate_1.6.0
[46] assertthat_0.1 httr_1.2.1 R6_2.2.0 nlme_3.1-128 git2r_0.18.0
from tabulapdf.
Java SE 6
from tabulapdf.
Facing the same issue. Would appreciate help.
from tabulapdf.
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/[email protected]", verbose = TRUE)
from tabulapdf.
I installed tabulizerjarms v0.9.0 but still getting the same error:
> 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("data/raw/Appendix D. Counts of Scleractinians, Octocorals and Sponges during Base....pdf",
columns = columns, pages = p, guess = F) at #9
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.12.3 (Sierra)
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 tabulizerjars_0.9.0 stringr_1.1.0 reshape2_1.4.1
loaded via a namespace (and not attached):
[1] magrittr_1.5 plyr_1.8.4 tools_3.3.1 Rcpp_0.12.10 stringi_1.1.1 git2r_0.15.0 ghit_0.2.12
[8] rJava_0.9-8 png_0.1-7
from tabulapdf.
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.
from tabulapdf.
I have the same problem.
Version
R version 3.3.3 (2017-03-06) -- "Another Canoe"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Code from ?extract_files
f <- system.file("examples", "data.pdf", package = "tabulizer")
extract_tables(f)
Traceback
6.
stop(structure(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", ...
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, ...
3.
.jrcall(x, name, ...)
2.
spreadsheetExtractor$isTabular(page)
1.
extract_tables(f)
Thank you
from tabulapdf.
Version
R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.12.3 (Sierra)
Code
f <- system.file("examples", "data.pdf", package = "tabulizer")
extract_tables(f)
Reply
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :
java.lang.NoSuchMethodError: java.lang.Integer.compare(II)I
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)
from tabulapdf.
@leeper I'm quite sure that this only happens in Java 6.
from tabulapdf.
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.
Exception in thread "main" java.lang.NoSuchMethodError: java.lang.Integer.compare(II)I
at technology.tabula.TextChunk.isLtrDominant(TextChunk.java:179)
at technology.tabula.TextElement.mergeWords(TextElement.java:271)
at technology.tabula.TextElement.mergeWords(TextElement.java:105)
at technology.tabula.extractors.BasicExtractionAlgorithm.extract(BasicExtractionAlgorithm.java:46)
at technology.tabula.CommandLineApp$TableExtractor.extractTablesBasic(CommandLineApp.java:385)
at technology.tabula.CommandLineApp$TableExtractor.extractTables(CommandLineApp.java:359)
at technology.tabula.CommandLineApp.extractFile(CommandLineApp.java:166)
at technology.tabula.CommandLineApp.extractFileTables(CommandLineApp.java:123)
at technology.tabula.CommandLineApp.extractTables(CommandLineApp.java:104)
at technology.tabula.CommandLineApp.main(CommandLineApp.java:74)
from tabulapdf.
@jkeuskamp Can you run java -version
on a terminal? I'd like to confirm if that error occurs only with Java 6.
from tabulapdf.
from tabulapdf.
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)
from tabulapdf.
@supermdat could you confirm that java 8 is indeed called from R?
You can check this by typing
library(rJava)
.jinit()
.jcall("java/lang/System", "S", "getProperty", "java.runtime.version")
this should return someting like
"1.8.0_121-b13"
The second number tells you whether java 6/7/8 is called.
from tabulapdf.
Thanks very much, @jkeuskamp . That is indeed the difference.
Running java -version from terminal gives:
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
However, running this from within RStudio gives:
library(rJava)
.jinit()
.jcall("java/lang/System", "S", "getProperty", "java.runtime.version")
"1.6.0_65-b14-468-11M4833"
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.
from tabulapdf.
@leeper Just noticed that the README.Rmd mentions:
On Mac OS, you may need to install a particular version of Java prior to attempting to install tabulizer.
You probably want to remove this line, as tabulizer now requires Java 7/8
from tabulapdf.
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!
from tabulapdf.
@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.: ghit::install_github("ropensci/[email protected]")
from tabulapdf.
Related Issues (20)
- Specifying columns as percentages
- Having problems with automate table recognition, can one save areas found manually for reproduction?
- {tabulizer} got archived on CRAN on 2021-10-31 HOT 20
- extract_tables function status was 'SSL connect error' error
- Select multiple areas per page in `*_areas()`
- q question about package( Tabulizer) installation HOT 4
- a suggested code or documentation change, improvement to the code, or feature request HOT 1
- inconsistent behavior of extract_tables and extract_areas HOT 4
- Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, : java.lang.IllegalAccessException: class RJavaTools cannot access a member of class java.util.ArrayList$Itr (in module java.base) with modifiers "public" HOT 11
- New Maintainer Wanted :-) HOT 6
- An illegal reflective access operation has occurred HOT 1
- Renaming to tabula HOT 2
- Windows CI fails because of Java 8 requirement HOT 1
- build fails with tabula 1.2.1 jar HOT 1
- ROADMAP FOR FALL 2023 HOT 6
- Unable to install in tabulizer HOT 1
- pkgdown building issue HOT 10
- Is jdk7 -y needed? HOT 6
- Is the package abandoned? HOT 1
- Issue with extract_tables function. Couldn't run the example: getRowCount HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tabulapdf.