Skip to content
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

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

Closed
AndreMikulec opened this issue Jun 16, 2017 · 11 comments

Comments

@AndreMikulec
Copy link

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
Copy link
Owner

salimk commented Jun 16, 2017

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
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

salimk commented Jun 16, 2017

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
Copy link
Author

O.K.

@AndreMikulec
Copy link
Author

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
Copy link
Author

I do not know the correct answer, but so far

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

seems to work.

@AndreMikulec
Copy link
Author

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

@AndreMikulec AndreMikulec changed the title Installation on Windows 10 64bit: onLoad failed in loadNamespace() for 'rJava' Error: ERROR: no packages specified Installation on Windows 10 64 bit error: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java Jun 17, 2017
@AndreMikulec AndreMikulec changed the title Installation on Windows 10 64 bit error: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java Installation on Windows 10 64 bit error No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java Jun 17, 2017
@salimk
Copy link
Owner

salimk commented Jun 17, 2017

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
Copy link
Author

AndreMikulec commented Jun 17, 2017 via email

@AndreMikulec
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants