salimk / Rcrawler

An R web crawler and scraper
http://www.sciencedirect.com/science/article/pii/S2352711017300110
Other
350 stars 92 forks source link

Installation on Windows 10 64 bit error No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java #1

Closed AndreMikulec closed 7 years ago

AndreMikulec commented 7 years ago

When I try to install I get this error.

> install.packages("Rcrawler")
Installing package into 'W:/R-3.4._/R_LIBS_USER_3.4._'
(as 'lib' is unspecified)
installing the source package 'Rcrawler'

trying URL 'http://cran.rstudio.com/src/contrib/Rcrawler_0.1.tar.gz'
Content type 'application/x-gzip' length 20944 bytes (20 KB)
downloaded 20 KB

* installing *source* package 'Rcrawler' ...
** package 'Rcrawler' successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
Error: package or namespace load failed for 'Rcrawler':
 .onLoad failed in loadNamespace() for 'rJava', details:
  call: fun(libname, pkgname)
  error: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java and make sure R and Java have matching architectures.
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'W:/R-3.4._/R_LIBS_USER_3.4._/Rcrawler'

The downloaded source packages are in
        'W:\R-3.4._\R_USER_3.4.__R_STUDIO\AppData\Local\Temp\RtmpOGEDmM\downloaded_packages'
Warning messages:
1: running command '"W:/R-3.4._/App/R-Portable/bin/x64/R" CMD INSTALL -l "W:\R-3.4._\R_LIBS_USER_3.4._" W:\R-3.4._\R_USER_3.4.__R_STUDIO\AppData\Local\Temp\RtmpOGEDmM/downloaded_packages/Rcrawler_0.1.tar.gz' had status 1
2: In install.packages("Rcrawler") :
  installation of package 'Rcrawler' had non-zero exit status

But rJava loads fine

> library(rJava)

I tried running the installation manually

shell("start cmd /k", wait = FALSE)

W:\R-3.4._>"W:/R-3.4._/App/R-Portable/bin/x64/R" CMD INSTALL -l "W:\R-3.4._\R_LIBS_USER_3.4._" W:\R-3.4._\R_USER_3.4.__R_STUDIO\AppData\Local\Temp\RtmpSojYP9/downloaded_packages/Rcrawler_0.1.tar.gz'
Warning: invalid package 'W:\R-3.4._\R_USER_3.4.__R_STUDIO\AppData\Local\Temp\RtmpOGEDmM/downloaded_packages/Rcrawler_0.1.tar.gz''
Error: ERROR: no packages specified

I Checked the contents of (that does exist) W:\R-3.4._\R_USER_3.4.__R_STUDIO\AppData\Local\Temp\RtmpOGEDmM/downloaded_packages/Rcrawler_0.1.tar.gz

Rcrawler_0.1.tar

Perhaps the contents are not correct? Was the .tar.gz made with "R CMD"?


> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 14393)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_3.4.0
salimk commented 7 years ago

The error message is clear , No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java and make sure R and Java have matching architectures. The reason is probably linked to the fact you are using a 64-bit OS and R version but do not have Java installed with the same architecture. Try download Java 64-bit and 32-bit , Then run to ensure that JRE is installed correctly .

system("java -version")

waiting for your reply

AndreMikulec commented 7 years ago

I have Windows 10 64bit. Before writing up the issue. I had installed the latest java ( JDK ) from the Oracle website:

jdk-8u131-windows-x64.exe
> system("java -version")
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

The errors above occur just after ( in the section )

*** arch - i386

I had remember running into an install of something similar. Another author package author had components that were ONLY 32bit (created in the days before 64 bit existed). My attempted installation of the package made it fine through the 'i386' part fine, but then later died in the 'x64' section. I never found a method to install the package.

Same problem here.

> install.packages("helloJavaWorld", type = "source")
arch - i386
Error: package or namespace load failed for 'rJava':
 .onLoad failed in loadNamespace() for 'rJava', details:
  call: fun(libname, pkgname)
  error: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java and make sure R and Java have matching architectures.

The Portable version has the same version

C:\Users\Me\Downloads\jPortable64_8_Update_131\bin>java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

C:\Users\Me\Downloads\jPortable64_8_Update_131\bin>

Hmm. Let me try some other things ...

AndreMikulec commented 7 years ago

I tried putting the jvm.dll in my path following. ( I also tried being explicit about my Java location.)

set PATH=C:\Program Files\Java\jdk1.8.0_131\jre\bin\server;C:\Program Files\Java\jdk1.8.0_131\bin;%PATH%

I verified that I do not have a JAVA_HOME variable

> Sys.getenv("JAVA_HOME")
[1] ""

following

Using the rJava package on Win7 64 bit with R
https://stackoverflow.com/questions/7019912/using-the-rjava-package-on-win7-64-bit-with-r/7604469#7604469

That did not work. Same error.

I tried RStudio "Build Binary Package". That did not work. Same error.

salimk commented 7 years ago

i will build the jar in the package with an old jdk version to make it compatible with all java version; then i will send you the package to install it .

AndreMikulec commented 7 years ago

O.K.

AndreMikulec commented 7 years ago

This variation "-no-multiarch" works.

>  install.packages("Rcrawler", INSTALL_opts = "--no-multiarch")

Installing package into 'W:/R-3.4._/R_LIBS_USER_3.4._'
(as 'lib' is unspecified)
installing the source package 'Rcrawler'

trying URL 'http://cran.rstudio.com/src/contrib/Rcrawler_0.1.tar.gz'
Content type 'application/x-gzip' length 20944 bytes (20 KB)
downloaded 20 KB

* installing *source* package 'Rcrawler' ...
** package 'Rcrawler' successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (Rcrawler)

The downloaded source packages are in
        'W:\R-3.4._\R_USER_3.4.__R_STUDIO\AppData\Local\Temp\Rtmp0kBtaj\downloaded_packages'
> library(Rcrawler)
> pageinfo<-LinkExtractor("http://glofile.com/index.php/2017/06/08/athletisme-m-a-rome/")
> str(pageinfo)
List of 2
 $ :List of 10
  ..$ : int 236
  ..$ : chr "http://glofile.com/index.php/2017/06/08/athletisme-m-a-rome/"
  ..$ : chr "finished"
  ..$ : int 902
  ..$ : num 5
  ..$ : chr ""
  ..$ : int 200
  ..$ : chr "text/html"
  ..$ : chr "charset=UTF-8"
  ..$ : chr "<!DOCTYPE html>\n<html lang=\"en-US\" class=\"no-js no-svg\">\n<head>\n<meta charset=\"UTF-8\">\n<meta name=\"v"| __truncated__
 $ : chr [1:5] "http://glofile.com/" "http://glofile.com/index.php/author/kassila/" "http://glofile.com/index.php/category/news/" "http://glofile.com/index.php/2017/06/08/passation-de-pouvoir-brigitte-macron-seduit-et-derange-la-presse-internationale/" ...
AndreMikulec commented 7 years ago

I do not know the correct answer, but so far

>  install.packages("Rcrawler", INSTALL_opts = "--no-multiarch")

seems to work.

AndreMikulec commented 7 years ago

For anyone who cares this is a good tester.

# does not work
install.packages("helloJavaWorld", type = "source")

*** arch - i386
Error: package or namespace load failed for 'rJava':
 .onLoad failed in loadNamespace() for 'rJava', details:
  call: fun(libname, pkgname)
  error: No CurrentVersion entry in Software/JavaSoft registry! 
Try re-installing Java and make sure R and Java have matching architectures.
# works
install.packages("helloJavaWorld", type = "source", INSTALL_opts = "--no-multiarch")
> library(helloJavaWorld)
Loading required package: rJava

> helloJavaWorld()
[1] "Hello Java World!"

> shell("java -version")
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 14393)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] helloJavaWorld_0.0-9 rJava_0.9-8

loaded via a namespace (and not attached):
[1] compiler_3.4.0 tools_3.4.0
salimk commented 7 years ago

could you please install this package normally without option, we need to resolve the package issue , waiting for your replay https://github.com/salimk/Rcrawler/blob/master/Rcrawler_0.1.tar.gz

AndreMikulec commented 7 years ago

O.K. I tried.

  1. Downloaded from https://github.com/salimk/Rcrawler/blob/master/Rcrawler_0.1.tar.gz C:\Users\Me\Downloads\Rcrawler_0.1.tar.gz

  2. RGui->Install package(s) from local files... C:\Users\Me\Downloads\Rcrawler_0.1.tar.gz

utils:::menuInstallLocal()

  • installing source package 'Rcrawler' ... R inst preparing package for lazy loading help installing help indices building package indices testing if installed package can be loaded arch - i386 Error: package or namespace load failed for 'Rcrawler': .onLoad failed in loadNamespace() for 'rJava', details: call: fun(libname, pkgname) error: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java and make sure R and Java have matching architectures. Error: loading failed Execution halted *** arch - x64 ERROR: loading failed for 'i386'
  • removing 'W:/R-3.4._/R_LIBS_USER3.4./Rcrawler'
  • restoring previous 'W:/R-3.4._/R_LIBS_USER3.4./Rcrawler' Warning messages: 1: running command '"W:/R-3.4./App/R-Portable/bin/x64/R" CMD INSTALL -l "W:\R-3.4.\R_LIBS_USER3.4." "C:/Users/Me/Downloads/Rcrawler_0.1.tar.gz"' had status 1 2: In install.packages(files[tarballs], .libPaths()[1L], repos = NULL, : installation of package ‘C:/Users/Me/Downloads/Rcrawler_0.1.tar.gz’ had non-zero exit status

Andre Mikulec Andre_Mikulec@Hotmail.com


From: Salim KHALIL notifications@github.com Sent: Friday, June 16, 2017 9:32 PM To: salimk/Rcrawler Cc: AndreMikulec; State change Subject: Re: [salimk/Rcrawler] Installation on Windows 10 64 bit error No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java (#1)

could you please install this package normally without option, we need to resolve the package issue , waiting for your replay https://github.com/salimk/Rcrawler/blob/master/Rcrawler_0.1.tar.gz

[https://avatars2.githubusercontent.com/u/17308124?v=3&s=400]https://github.com/salimk/Rcrawler/blob/master/Rcrawler_0.1.tar.gz

salimk/Rcrawlerhttps://github.com/salimk/Rcrawler/blob/master/Rcrawler_0.1.tar.gz github.com Rcrawler - RCrawler for web crawling and scraping using R

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/salimk/Rcrawler/issues/1#issuecomment-309181553, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAK9qp-fbwV7PDL9iszCt84ivfyCLWFKks5sEyyagaJpZM4N785-.

AndreMikulec commented 7 years ago

If a windows machine is not available, then perhaps the CRAN winbuilder may be a good idea.

Building and checking R source packages for Windows.

https://win-builder.r-project.org/

Specifically ... the page ...

R-release https://win-builder.r-project.org/upload.aspx