score:21
I found the solution:
export LD_LIBRARY_PATH=/usr/lib/jvm/java-7-oracle/lib/amd64:/usr/lib/jvm/java-7-oracle/jre/lib/amd64/server
then
sudo R CMD javareconf
Note: The path (java-7-oracle) needs to be updated based on your Java installation.
score:0
When facing missing limjvm.so
errors make sure that the correct ldpaths
is picked up from the standard configuration in /etc/R
versus the one in /usr/lib/R/etc
.
score:0
This fixes the LD_LIBRARY_PATH problem for me (Linux, Debian 7.1.0, tc-shell, R version 3.0.2):
Add this line to .cshrc:
setenv LD_LIBRARY_PATH $JAVA_HOME/jre/lib/amd64:$JAVA_HOME/jre/lib/amd64/server
Adding this command to ~/.login was not enough; the environment variable LD_LIBRARY_PATH was still not known in new xterms: echo $LD_LIBRARY_PATH : LD_LIBRARY_PATH: Undefined variable. (Why??)
Curiously, when starting R as superuser, there was no problem with finding libjvm.so .
score:0
I fixed this by just running R with sudo, and then running install.packages('rJava`)
.
score:0
None of the above worked for me, the only solution that installed rJava
on Linux Ubuntu without any problems was to pass RScript
command after installation of the base R:
$ sudo Rscript -e 'install.packages("rJava", repos = "http://cran.r-project.org/")'
score:1
I did not had the jdk installed which I could fix with
sudo apt-get install jdk-*
After that i could run the sudo R CMD javareconf
which always drew an error message before. Everything was set correctly and no manual tweeks where required, and after that package installation ran smootly in R (restart required).
score:2
or just set the library in R?
I just ran this command in R:
Sys.setenv(JAVA_HOME='/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server')
(replace "/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server" with your Java library path which can be found running "sudo R CMD javareconf")
Might not be the most elegant solution - but it worked for me!
score:3
Years later, I ended up on this question after searching for an error reported by R after I had unsuccessfully installed a package on that required shifting to Oracle's Java.
All I had to do to fix it was:
$ sudo R CMD javareconf
score:10
I did the following and it worked for me:
export LD_LIBRARY_PATH=$JAVA_LD_LIBRARY_PATH
sudo R CMD javareconf
I had to restart R then as well.
score:31
I got similar issue and was able to resolve it by running
R CMD javareconf -e
Output of the R CMD javareconf -e
Java interpreter : /export/apps/jdk/JDK-1_6_0_27/jre/bin/java
Java version : 1.6.0_27
Java home path : /export/apps/jdk/JDK-1_6_0_27
Java compiler : /export/apps/jdk/JDK-1_6_0_27/bin/javac
Java headers gen.: /export/apps/jdk/JDK-1_6_0_27/bin/javah
Java archive tool: /export/apps/jdk/JDK-1_6_0_27/bin/jar
Java library path: /export/apps/jdk/JDK-1_6_0_27/jre/lib/amd64/server:/export/apps/jdk/JDK-1_6_0_27/jre/lib/amd64:/export/apps/jdk/JDK-1_6_0_27/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
JNI linker flags : -L/export/apps/jdk/JDK-1_6_0_27/jre/lib/amd64/server -L/export/apps/jdk/JDK-1_6_0_27/jre/lib/amd64 -L/export/apps/jdk/JDK-1_6_0_27/jre/../lib/amd64 -L/usr/java/packages/lib/amd64 -L/usr/lib64 -L/lib64 -L/lib -L/usr/lib -ljvm
JNI cpp flags : -I/export/apps/jdk/JDK-1_6_0_27/include -I/export/apps/jdk/JDK-1_6_0_27/include/linux
The following Java variables have been exported:
JAVA_HOME JAVA JAVAC JAVAH JAR JAVA_LIBS JAVA_CPPFLAGS JAVA_LD_LIBRARY_PATH
Running: /bin/bash
After setting LD_LIBRARY_PATH
to the same value as JAVA_LD_LIBRARY_PATH
as shown in the output above. I was able to install rj.
export LD_LIBRARY_PATH=/export/apps/jdk/JDK-1_6_0_27/jre/lib/amd64/server:/export/apps/jdk/JDK-1_6_0_27/jre/lib/amd64:/export/apps/jdk/JDK-1_6_0_27/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
Run R and then install rj by
install.packages(c("rj", "rj.gd"), repos="http://download.walware.de/rj-1.1")
score:80
For Linux(Ubuntu) users: If you have oracle-java (7/8) installed. It'll be at this location /usr/lib/jvm
and sudo
access is required.
Create the file /etc/ld.so.conf.d/java.conf
with the following entries:
/usr/lib/jvm/java-8-oracle/jre/lib/amd64
/usr/lib/jvm/java-8-oracle/jre/lib/amd64/server
(Replace java-8-oracle with java-7-oracle depending on your java version)
Then:
sudo ldconfig
Restart RStudio and then install the rJava package.
OR
Also an alternative method is to export LD_LIBRARY_PATH
with the value of Java library path obtained from the command R CMD javareconf -e
and run install.packages
Source: stackoverflow.com
Related Query
- error: unable to load installed packages just now
- Unable to load class from installed jar in maven
- I installed another android api, then I got error that adb needs to update, now eclipse not starting
- I have just installed android SDK updates and now my projects are full of errors
- Sonarlint for Eclipse - Unable to load plugin bundleentry error
- How to resolve Unable to load authentication plugin 'caching_sha2_password' issue
- SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". error
- subclipse: Unable to load default SVN Client
- When I load ADT why do I receive the error "The Android SDK requires Android Developer Toolkit version XX.X.X or above?"
- An error occurred while collecting items to be installed (Access is denied)
- Subclipse in Mac OS Lion shows "Unable to load default SVN client" error
- Plug-in com.android.ide.eclipse.adt was unable to load class android
- Getting an error "Could not load definitions from resource net/sf/antcontrib/antcontrib.properties. It could not be found."
- Unable to load the repository(PyDev for eclipse)
- Eclipse error "Could not find or load main class"
- Export APK from Eclipse produces error "No Build Tools installed in the SDK"
- An error occurred while collecting items to be installed
- UnsatisfiedLinkError - Unable to load library - Native library not found in resource path
- (Eclipse SDK update error) An error occur while collecting items to be installed
- Eclipse (STS) Welcome dash board error - Unable to see welcome dash board
- Unable to find a javac compiler com.sun.tools.javac.Main is not on the classpath error
- Error : Unable to execute dex
- Axis2 error : Unable to add the following facets
- Just installed Windows 10 and Eclipse no more starts
- Unable to compile class for JSP error when I'm running my code in eclipse gwt project
- Installing AJDT I got a Plug-in org.eclipse.jdt.ui was unable to load class org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor
- Unable to run "Hello World" Drools example in Eclipse: runtime exception org.drools.RuntimeDroolsException: Unable to load dialect
- I just installed EGit on Eclipse -- but Where is it?
- plug-in org.eclipse.m2e.core.ui was unable to load class
- Unable to open DDMS in Android Studio. Mysterious Eclipse error pops up
More Query from same tag
- Eclipse execute Maven build with tests
- Opening Quadratic Sieve Jar file in Java
- Add SWT dependency to POM
- GitHub How to supplant known-defective Master with an authoritative Branch
- Android app not showing any error but crash on startup?
- Java EE "JDI Event Dispatch" error
- suitable data structure for storing java project information
- weird behavior when loading jar inside a jar in Java Web Start
- java.lang.IllegalArgumentException: AppCompat does not support the current theme features
- Unable to hot deploy from SpringSource Tool Suite 2.8.1 to GlassFish 3.1
- How to reliably and quickly develop against a remote server with a local IDE?
- How to change port of tomcat from eclipse's tomcat plugin
- Cannot resolve class in same package, async android development using eclipse
- Why won't the GWT designer for eclipse work with GXT 3 widgets?
- Android Studio: Failed to sync Gradle project 'Project Name'
- Unable to configure JIRA in eclipse mylyn task
- symfony2 php codesniffer standard error
- Grabbing the inherited background image of a SWT component (Scrolled Composite)
- ObjectAid equivalent in IntelliJ
- Multi IDE version controlled Java project - Is it possible to do it seamlessly?
- why i got this message[“Variable name” cannot be resolved to a variable]?
- JAR Unable to load text files after export
- Could not find or load main
- Want option back to choose between running app in device or emulator
- Eclipse displaying compilation error messages while using lombok API
- .Jar File Has Compile Errors When Decompiled But Works Properly
- Workspace closed error when trying to use resources/projects outside Eclipse
- Pom.xml error in Eclipse
- Best way to manage a django project on a remote server with eclipse
- Is there any way to change Eclipse editor navigation to Vim style?