0

When I run Rterm.exe, I get a problem with Java. I just launch Rterm.exe and try to retrieve the Java version by using system("java - version") but it doesn't even work

R version 3.0.1 (2013-05-16) -- "Good Sport"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> system("java -version")
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
> Sys.getenv("JAVA")
[1] "H:\\R\\jre-7u10-windows-x64\\jre1.7.0_10\\bin\\"
Vogel612
  • 5,620
  • 5
  • 48
  • 73
pam
  • 676
  • 1
  • 7
  • 27
  • Have you tried these pointers? http://stackoverflow.com/questions/11808829/jre-1-7-returns-java-lang-noclassdeffounderror-java-lang-object – Roman Luštrik Nov 18 '14 at 13:28

2 Answers2

1

I don't think you need java path to be set in a JAVA environment variable - eventually you could set it in the PATH environment variable, see How do I set or change the PATH system variable.

However I don't have any java reference in any environment variable and it works fine on my Windows 8.1 with java versions 1.6 to 1.8.

This issue may come from an improper java installation (an installation without administration rights or an installation just consisting in unzipping a java zip directory). It can make rJava unable to be loaded for example. The simplier solution will probably be to uninstall and then reinstall Java with an installer.

If not possible, try to set and configure your java environment with the java control panel (in the tab "java"). See Where is the Java Control Panel on Windows?.

David Gohel
  • 9,180
  • 2
  • 16
  • 34
0

I have a line like this in my code :

options(java.home="C:/Program Files/Java/jre7/")

Try to see if that fixes it. Make sure java is properly installed and the path is correct.

rawr
  • 20,481
  • 4
  • 44
  • 78
Romain
  • 839
  • 10
  • 24