Glassfish updatetool linux 64 bit issue - glassfish-3

I am trying to run glassfish updatetool my in Ubuntu 12.04 x64. When I run the program it gives me following error.
---------------------------------------------------------------
There was an error running
/home/mrmrumman/glassfish3/updatetool/bin/../../pkg/python2.4-minimal/bin/python
You are running on a 64 bit Linux distribution and the 32 bit Linux
compatibility libraries do not appear to be installed. In order to use
the Update Center tools you must install the 32 bit compatibility libraries.
On Ubuntu (and possibly other Debian based systems) please install the
ia32-libs package. On RedHat 4 (and other RPM based systems), you may
need to add multiple 'compat' runtime library packages. Please see the
Update Center Release Notes for more information
I already install this package still it doesn't work. What can I do?

You also need to install 32 bit version of libjpeg.so.62 .
You can do so by running this command
sudo apt-get install libjpeg62:i386
Source : https://java.net/projects/updatecenter/lists/dev/archive/2012-05/message/0

For glassfish4 on ubuntu 12.04 x64 make sure you have the recommended updates for precise ticked in Settings of Update Manager, then
sudo apt-get install ia32-libs
This is not quite enough though because the pkg command looks for those libs in the wrong directories for the ubuntu installation. Help it find them with this command
sudo ln -s /lib/i386-linux-gnu /usr/lib32
Then the pkg command should work fine.

Related

rJava package don't find Java [duplicate]

When installing rJava using the install.packages("rJava") command I get the following error:
checking Java support in R... present:
interpreter : '/usr/bin/java'
archiver : '/usr/bin/jar'
compiler : '/usr/bin/javac'
header prep.: '/usr/bin/javah'
cpp flags : '-I/usr/lib/jvm/java-6-sun-1.6.0.20/jre/../include -I/usr/lib/jvm/java-6-sun-1.6.0.20/jre/../include/linux'
java libs : '-L/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64/server -L/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64 -L/usr/lib/jvm/java-6-sun-1.6.0.20/jre/../lib/amd64 -L -L/usr/java/packages/lib/amd64 -L/usr/lib64 -L/lib64 -L/lib -L/usr/lib -ljvm'
checking whether JNI programs can be compiled... yes
checking JNI data types... configure: error: One or more JNI types differ from the corresponding native type. You may need to use non-standard compiler flags or a different compiler in order to fix this.
ERROR: configuration failed for package ‘rJava’
I have the Java JDK installed and java -version returns the following:
$ java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
When Googling around for the error I see that others are having the same issue but not finding a solution other than "install the whole JDK, not just the JRE" which I have done.
The other thing I read was to run sudo R CMD javareconf which runs quite happily with no errors.
Any ideas what my problem is?
[[EDIT]]
It's been a few months since I had this problem. I had initially solved this by editing my Java paths, as illustrated in the answer I posted below. I recently ran into the same issue on a new Ubuntu install. I tried Dirk's recommendation to use apt-get to install the rJava package. It worked perfectly. What I failed to appreciate initially is that installing packages using the Ubuntu apt-get method is fundamentally different than just loading the same package using install.packages() inside of R. The Ubuntu packages solve some issues which I didn't realize or appreciate.
Wouldn't
apt-get install r-cran-rjava
have been easier? You could have asked me at useR! :)
Turns out my problem was an issue with my JAVA_HOME environment variable. Yes, shocking I know. My initial setting for PATH and JAVA_HOME looked like this:
export JAVA_HOME=/usr/lib/jvm/java-6-sun
export PATH=$PATH:$JAVA_HOME/bin
And I added /jre so it now looks like this:
export JAVA_HOME=/usr/lib/jvm/java-6-sun/jre
export PATH=$PATH:$JAVA_HOME/bin
Everything in Java seemed to work fine without the /jre but rJava would not. Odd.
That is how I make it work :
In Linux (Ubuntu 16.04 and 20.04 worked confirmed)
sudo apt-get install default-jre
sudo apt-get install default-jdk
sudo R CMD javareconf
in R:
install.packages("rJava")
Thanks - your suggestion about $JAVA_HOME lead me to a similar solution:
unset JAVA_HOME
before invoking R.
I came across the same issue, and it worked after running commands below.
export JAVA_LIBS="$JAVA_LIBS -ldl"
R CMD javareconf
See details at
http://www-01.ibm.com/support/knowledgecenter/SSPT3X_3.0.0/com.ibm.swg.im.infosphere.biginsights.install.doc/doc/install_install_r.html
This worked for me on Ubuntu 12.04 and R version 3.0
cd /usr/lib/jvm/java-6-sun-1.6.0.26/include
this is the directory that has jni.h
Next create a soft link to another required header file (I'm too lazy to find out how to include more than one directory in the JAVA_CPPFLAGS option below):
sudo ln -s linux/jni_md.h .
Finally
sudo R CMD javareconf JAVA_CPPFLAGS=-I/usr/lib/jvm/java-6-sun-1.6.0.26/include
below is one of my answers on another post - error: unable to load installed packages just now
(this is also relevant to this question)
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.
Running R under Gentoo on an AMD64. I upgraded to R 2.12.0
R version 2.12.0 (2010-10-15)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-pc-linux-gnu (64-bit)
and those pesky messages went away.
Jan Vandermeer
I tried to install openjdk-7-* but still I had problems installing rJava. Turns out after I restarted my computer, then there was no problem at all.
so
sudo apt-get install openjdk-7-*
RESTART after installing java, then try to install package "rJava" in R
The rJava package looks for the /usr/lib/jvm/default-java/ folder. But it's not available as default. This folder have a symlink for the default java configured for the system.
To activate the default java install the following packages:
sudo apt-get install default-jre default-jre-headless
Tested on ubuntu 17.04 with CRAN R 3.4.1
What worked for me was changing JAVA_HOME from file /usr/lib/R/etc/javaconf
I first checked what was my version of Java enabled : sudo update-alternatives --config java.
In my case, it was java-8-oracle
I opened the file /usr/lib/R/etc/javaconf and replaced default-java by java-8-oracle :
${JAVA_HOME=/usr/lib/jvm/default-java}
replaced by :
${JAVA_HOME=/usr/lib/jvm/java-8-oracle}
And then sudo R CMD javareconf
I restarted RStudio, and could then install rJava.
what I do is here:
in /etc/apt/sources.list, add:
deb http://ftp.de.debian.org/debian sid main
Note:the rjava should be latest version
2 run:
sudo apt-get update
sudo apt-get install r-cran-rjava
Once update the old version of rjava, then can install rhdfs_1.0.8.
I got it working by downloading : https://cran.r-project.org/src/contrib/rJava_0.9-8.tar.gz and running command R CMD install rJava_0.9-8.tar.gz
I was facing the same problem while using Windows 10. I have solved the problem using the following procedure
Download Java from https://java.com/en/download/windows-64bit.jsp for 64-bit windows\Install it
Download Java development kit from https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html for 64-bit windows\Install it
Then right click on “This PC” icon in desktop\Properties\Advanced system settings\Advanced\Environment Variables\Under System variables select Path\Click Edit\Click on New\Copy and paste paths “C:\Program Files\Java\jdk1.8.0_201\bin” and “C:\Program Files\Java\jre1.8.0_201\bin” (without quote) \OK\OK\OK
Note: jdk1.8.0_201 and jre1.8.0_201 will be changed depending on the version of Java development kit and Java
In Environment Variables window go to User variables for User\Click on New\Put Variable name as “JAVA_HOME” and Variable value as “C:\Program Files\Java\jdk1.8.0_201\bin”\Press OK
To check the installation, open CMD\Type javac\Press Enter and
Type java\press enter
It will show
In RStudio run
Sys.setenv(JAVA_HOME="C:\\Program Files\\Java\\jdk1.8.0_201")
Note: jdk1.8.0_201 will be changed depending on the version of Java development kit
Now you can install and load rJava package without any problem.
The problem was rJava wont install in RStudio (Version 1.0.136). The following worked for me (macOS Sierra version 10.12.6) (found here):
Step-1: Download and install javaforosx.dmg from here
Step-2: Next, run the command from inside RStudio:
install.packages("rJava", type = 'source')
On Arch Linux, I needed to install openjdk-src to get a JNI path working.
In other words, these are the packages I needed to install before sudo R CMD javareconf ran successfully:
local/jdk-openjdk 14.0.2.u12-1
OpenJDK Java 14 development kit
local/jre-openjdk 14.0.2.u12-1
OpenJDK Java 14 full runtime environment
local/jre-openjdk-headless 14.0.2.u12-1
OpenJDK Java 14 headless runtime environment
local/openjdk-src 14.0.2.u12-1
OpenJDK Java 14 sources
Assuming you have sudo privileges and not in Ubuntu where package manager makes this easier -- I tried variations of prior answers and found this gem on Databricks blog for nonUbuntu (https://kb.databricks.com/r/install-rjava-rjdbc-libraries.html)
Installed JDK
sudo apt-get install openjdk-8-jdk
Verify path to libjvm.so; for me-->
cd /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64
grep -r libjvm
output:
Binary file server/libjvm.so matches <<<<<<<<
Do java configure
sudo R CMD javareconf
Remove prior versions of the package and install 'rJava' from CRAN mirror in RStudio
Restart RStudio
In RStudio verify link to libjvm.so
dyn.load('/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so')
library('rJava')
I've encountered similar problem on Ubuntu 16.04 and was able to solve it by creating a folder named "default-java" in /usr/lib/jvm and copying into it all the contents of the /usr/lib/jvm/java-8-oracle. I opted for this solution as correcting JAVA_HOME environment variable turned out to be of no use.

Install R 3.1.2 on Wheezy 7.8 (Raspbian) fails

I'm a newbie to Linux and try to install the latest R version on my Raspberry.
My Raspberry runs on Wheezy 7.8.
I followed instructions on CRAN, so I
added
deb http://cran.rstudio.com/bin/linux/debian wheezy-cran3/
to /etc/apt/sources.list
ran apt-get update which was successful and gave me only a "signature error" for the public key as pointed out on the CRAN-site
ran apt-get install r-base
But the result of the last command is
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
r-base : Depends: r-base-core (>= 3.1.2-1~wheezycran3.0) but it is not going to be installed
Depends: r-recommended (= 3.1.2-1~wheezycran3.0) but it is not going to be installed
Recommends: r-base-html but it is not going to be installed
Recommends: r-doc-html but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I tried to install R-2.15 before and then run the above commands. R-2.15 could be installed successfuly, but I'd need R-3* really.
I did browse the web, but couldn't find any useful hints for my specific problem, so I appreciate any support you could give me.
Thanks!
If it is of any use:
apt-cache policy r-base gives
r-base:
Installed: (none)
Candidate: 3.1.2-1~wheezycran3.0
Version table:
3.1.2-1~wheezycran3.0 0
500 http://cran.rstudio.com/bin/linux/debian/ wheezy-cran3/ Packages
3.1.0-1~wheezycran3.0 0
500 http://cran.rstudio.com/bin/linux/debian/ wheezy-cran3/ Packages
2.15.1-4 0
500 http://mirrordirector.raspbian.org/raspbian/ wheezy/main armhf Packages
apt-cache policy r-base-core gives
r-base-core:
Installed: (none)
Candidate: 2.15.1-4
Version table:
2.15.1-4 0
500 http://mirrordirector.raspbian.org/raspbian/ wheezy/main armhf Packages
uname -a gives
Linux raspberrypi 3.18.5+ #744 PREEMPT Fri Jan 30 18:19:07 GMT 2015 armv6l GNU/Linux
I had the same situation and decided to install that from the source code instead of install R from the repository(apt-get command).
Here is the command I run on my Raspberry Pi 2.
I could install and run R(3.1.2) sucessfully.
It might not be complete answer for you because I might already installed the library like gcc you did not have before. If you encounter the other issue, please let me know. I would like to solve it.
Just as a side note on this topic, because sudo make install process took a long time(maybe over a hour. I'm not sure because I feel asleep before I knew it...), I recommend you to do this when you have enough or before going to sleep like me.
wget http://cran.rstudio.com/src/base/R-3/R-3.1.2.tar.gz
mkdir R_HOME
mv R-3.1.2.tar.gz R_HOME/
cd R_HOME/
tar zxvf R-3.1.2.tar.gz
cd R-3.1.2/
sudo apt-get install gfortran libreadline6-dev libx11-dev libxt-dev
./configure
make
sudo make install
R
The cause of your problem is likely that the cran repository provides armel versions of the packages, and not armhf (which is the expected architecture for your RPI). If this is right, then you have two solutions:
The first work-around could be to download the armel version of the packages and then force their installation despite the architecture mismatch. It is supposed to work according to the Debian wiki, although you may experience performance issues:
The CPU in the Raspberry Pi implements the ARMv6 ISA (with VFP2) and
is thus incompatible with the Debian armhf port baseline of ARMv7+VFP3
and ARM hardware-floating-point ports for other distributions, which
all have the same baseline. It is compatible with Debian armel
(armv4t, soft(emulated) FP), but floating-point tasks will be slow
when running the Debian armel port.
To do that, you can try to reinstall the packages by specifying the armel architecture, for example:
apt-get install r-base:armel
If it doesn't work this way, you can otherwise download the packages from http://cran.r-project.org/bin/linux/debian/wheezy-cran3/ and install them manually using a commandline like:
dpkg --install --force-architecture xxxx_armel.deb yyyy_armel.deb zzzz_armel.deb
The other solution would be to compile R from its source.
I solved my initial question by upgrading Wheezy to Jessie. I am not an expert, but Jessie seems to be the current testing version of Debian, while Wheezy is the stable release - see here.
For upgrading, I followed the instructions here, or here, or here. Note: Upgrading takes quite a while and during the process you're required to answer some questions.
A word of caution though: Jessie is still testing and some people recommend not to use it yet, for a discussion see e.g. here.
I did set it up completely from a new completely new image, and it works well.
After having upgraded to Jessie I installed R-3.1.1. using
sudo apt-get install r-base
And I'd like to thank all those who have answered my question and given alternative ways of solving the problem above.
I'm able to install R-3.1.2 into raspbian using answer from teramonagi. I confirm it can install successfully on Raspberry Pi model B/B+.
However, before you can actually use R (install packages and run some R scripts), you have to increase the swap file size for Raspberry Pi due to lack of RAM (This service works very similar to page file in window, it kicks in when RAM usage is high). You can configure it by edit one of the config file by enter command below in LX terminal.
sudo nano /etc/dphys-swapfile
CONF_SWAPSIZE=100 #(change 100 to 512 or 1024, up to you, save the file)
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start #(restart swap file service with new swap file size)
Take note though, some users argued that increase swap file size can actually ruin your SD card. So apply this change at your own risk. I've been running my Pi with this configuration for my R automation for 1 month now. No issue so far.
Hope this helps.
Edit: If you are using model B/B+, i recommend to configure swap file size first then compile R.
That's what I've done to update my r-base on wheezy:
HOW TO UPDATE r-base 2.15 to 3.x ON DEBIAN WHEEZY
add these lines at the end of "/etc/apt/sources.list"
deb http://cran.revolutionanalytics.com/bin/linux/debian wheezy-cran3/
deb-src http://cran.revolutionanalytics.com/bin/linux/debian wheezy-cran3/
add the missing publich key of cran
gpg --keyserver pgpkeys.mit.edu --recv-key 06F90DE5381BA480
gpg -a --export 06F90DE5381BA480 | sudo apt-key add -
update and upgrade
apt-get update
aptitude -t wheezy-cran3 install r-base r-base-dev

Install R 3+ on Redhat 6.3

I want to install R on my Red hat cluster which has the version below:
$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.3 (Santiago)
When I went to R's homepage and this is what in their repository:
I am wondering there is only redhat version 4 and 5 there and I don't know which version will best fit my operating system.
Texinfo Problem Goes Here
Since I have asked more than 6 questions today. Stackoverflow doesn't like me to ask more questions. So I will put the following questions into this question, sorry about that.
Hi, I was trying to use Expect to automatically log into a remote server and install R.
When I install R, they came up with all kinds of prompts asking 'The package will take xx MB Is that OK with you'?
The command to install:
su -c 'yum install R R-core R-core-devel R-devel'
You need to type in Yes for a few times to finish the installation.
My question is:
Is there a flag for yum install that you can tell the machine to install everything I want you to install. Don't ask me. So I can install those four packages without any prompt.
If that is hard to install in the 'quiet mode', how to write a while loop in Expect so it will send the Y automatically:
Pseudo Code Not Working!
send -- "sudo su -c yum install ...."
while ("Expect '*Is it OK [Y/N]*'"){
send 'Y\r'
# if (expect 'user$')
{break}
}
Thanks a lot in advance.
This is likely due to there being R RPMs in the Extra Packages for Enterprise Linux (EPEL) repos for RHEL6. You can find out more about EPEL on the Fedora website.
You need to configure yum to use EPEL. The easiest way to do this is to install the epel-release package for your platform, eg
su -c 'rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm'
or
su -c 'rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm'
for example. The you can use yum to install R, e.g. you will probably want
su -c 'yum install R R-core R-core-devel R-devel'
so that you pull in the packages needed to build other add-on packages as most CRAN package are not in EPEL.
At the moment, the latest version of R in EPEL is 3.0.1, so one patch release point behind the latest version 3.0.2.

How can I install qt5 to Debian using commandline?

I need to install Qt5 to my Debian using commandline. How can I do that?
My system:
debian 2.6.30-vortex86mx-yh
I am trying to install using qt online installer from qt-project.org.
But after ./qt.run I get this error:
libstdc++.so.6 version glibcxx_3.4.11 not found
I try to install libstdc++6. but Debian said it is already newest version.
cat /etc/issue result is:
Debian 5.0
Also my debian has no gui. I have to do it using commandline.
Try this command for installing from default debian 5 repository:
#apt install g++
#apt install qtcreator
#apt install qtdeclarative5-dev
You should be able to run the qt-installer in a decent debian version. Get Version by:
cat /etc/issue
On older versions or "unsupported" versions you can still download the sources and build the libraries yourself, which is probably your way to go, since the vortex86-builds are pretty limited in compiler flags. Compiling is rather easy, depending on your needs. The configure script itself gives you a lot of hints regarding possible flags.
Another alternative is to find a user-managed repository that has QT5 for your debian version and add this repository to your sources.lst, so you could perform a apt-get install libqt5.

R: rJava package install failing

When installing rJava using the install.packages("rJava") command I get the following error:
checking Java support in R... present:
interpreter : '/usr/bin/java'
archiver : '/usr/bin/jar'
compiler : '/usr/bin/javac'
header prep.: '/usr/bin/javah'
cpp flags : '-I/usr/lib/jvm/java-6-sun-1.6.0.20/jre/../include -I/usr/lib/jvm/java-6-sun-1.6.0.20/jre/../include/linux'
java libs : '-L/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64/server -L/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64 -L/usr/lib/jvm/java-6-sun-1.6.0.20/jre/../lib/amd64 -L -L/usr/java/packages/lib/amd64 -L/usr/lib64 -L/lib64 -L/lib -L/usr/lib -ljvm'
checking whether JNI programs can be compiled... yes
checking JNI data types... configure: error: One or more JNI types differ from the corresponding native type. You may need to use non-standard compiler flags or a different compiler in order to fix this.
ERROR: configuration failed for package ‘rJava’
I have the Java JDK installed and java -version returns the following:
$ java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
When Googling around for the error I see that others are having the same issue but not finding a solution other than "install the whole JDK, not just the JRE" which I have done.
The other thing I read was to run sudo R CMD javareconf which runs quite happily with no errors.
Any ideas what my problem is?
[[EDIT]]
It's been a few months since I had this problem. I had initially solved this by editing my Java paths, as illustrated in the answer I posted below. I recently ran into the same issue on a new Ubuntu install. I tried Dirk's recommendation to use apt-get to install the rJava package. It worked perfectly. What I failed to appreciate initially is that installing packages using the Ubuntu apt-get method is fundamentally different than just loading the same package using install.packages() inside of R. The Ubuntu packages solve some issues which I didn't realize or appreciate.
Wouldn't
apt-get install r-cran-rjava
have been easier? You could have asked me at useR! :)
Turns out my problem was an issue with my JAVA_HOME environment variable. Yes, shocking I know. My initial setting for PATH and JAVA_HOME looked like this:
export JAVA_HOME=/usr/lib/jvm/java-6-sun
export PATH=$PATH:$JAVA_HOME/bin
And I added /jre so it now looks like this:
export JAVA_HOME=/usr/lib/jvm/java-6-sun/jre
export PATH=$PATH:$JAVA_HOME/bin
Everything in Java seemed to work fine without the /jre but rJava would not. Odd.
That is how I make it work :
In Linux (Ubuntu 16.04 and 20.04 worked confirmed)
sudo apt-get install default-jre
sudo apt-get install default-jdk
sudo R CMD javareconf
in R:
install.packages("rJava")
Thanks - your suggestion about $JAVA_HOME lead me to a similar solution:
unset JAVA_HOME
before invoking R.
I came across the same issue, and it worked after running commands below.
export JAVA_LIBS="$JAVA_LIBS -ldl"
R CMD javareconf
See details at
http://www-01.ibm.com/support/knowledgecenter/SSPT3X_3.0.0/com.ibm.swg.im.infosphere.biginsights.install.doc/doc/install_install_r.html
This worked for me on Ubuntu 12.04 and R version 3.0
cd /usr/lib/jvm/java-6-sun-1.6.0.26/include
this is the directory that has jni.h
Next create a soft link to another required header file (I'm too lazy to find out how to include more than one directory in the JAVA_CPPFLAGS option below):
sudo ln -s linux/jni_md.h .
Finally
sudo R CMD javareconf JAVA_CPPFLAGS=-I/usr/lib/jvm/java-6-sun-1.6.0.26/include
below is one of my answers on another post - error: unable to load installed packages just now
(this is also relevant to this question)
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.
Running R under Gentoo on an AMD64. I upgraded to R 2.12.0
R version 2.12.0 (2010-10-15)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-pc-linux-gnu (64-bit)
and those pesky messages went away.
Jan Vandermeer
I tried to install openjdk-7-* but still I had problems installing rJava. Turns out after I restarted my computer, then there was no problem at all.
so
sudo apt-get install openjdk-7-*
RESTART after installing java, then try to install package "rJava" in R
The rJava package looks for the /usr/lib/jvm/default-java/ folder. But it's not available as default. This folder have a symlink for the default java configured for the system.
To activate the default java install the following packages:
sudo apt-get install default-jre default-jre-headless
Tested on ubuntu 17.04 with CRAN R 3.4.1
What worked for me was changing JAVA_HOME from file /usr/lib/R/etc/javaconf
I first checked what was my version of Java enabled : sudo update-alternatives --config java.
In my case, it was java-8-oracle
I opened the file /usr/lib/R/etc/javaconf and replaced default-java by java-8-oracle :
${JAVA_HOME=/usr/lib/jvm/default-java}
replaced by :
${JAVA_HOME=/usr/lib/jvm/java-8-oracle}
And then sudo R CMD javareconf
I restarted RStudio, and could then install rJava.
what I do is here:
in /etc/apt/sources.list, add:
deb http://ftp.de.debian.org/debian sid main
Note:the rjava should be latest version
2 run:
sudo apt-get update
sudo apt-get install r-cran-rjava
Once update the old version of rjava, then can install rhdfs_1.0.8.
I got it working by downloading : https://cran.r-project.org/src/contrib/rJava_0.9-8.tar.gz and running command R CMD install rJava_0.9-8.tar.gz
I was facing the same problem while using Windows 10. I have solved the problem using the following procedure
Download Java from https://java.com/en/download/windows-64bit.jsp for 64-bit windows\Install it
Download Java development kit from https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html for 64-bit windows\Install it
Then right click on “This PC” icon in desktop\Properties\Advanced system settings\Advanced\Environment Variables\Under System variables select Path\Click Edit\Click on New\Copy and paste paths “C:\Program Files\Java\jdk1.8.0_201\bin” and “C:\Program Files\Java\jre1.8.0_201\bin” (without quote) \OK\OK\OK
Note: jdk1.8.0_201 and jre1.8.0_201 will be changed depending on the version of Java development kit and Java
In Environment Variables window go to User variables for User\Click on New\Put Variable name as “JAVA_HOME” and Variable value as “C:\Program Files\Java\jdk1.8.0_201\bin”\Press OK
To check the installation, open CMD\Type javac\Press Enter and
Type java\press enter
It will show
In RStudio run
Sys.setenv(JAVA_HOME="C:\\Program Files\\Java\\jdk1.8.0_201")
Note: jdk1.8.0_201 will be changed depending on the version of Java development kit
Now you can install and load rJava package without any problem.
The problem was rJava wont install in RStudio (Version 1.0.136). The following worked for me (macOS Sierra version 10.12.6) (found here):
Step-1: Download and install javaforosx.dmg from here
Step-2: Next, run the command from inside RStudio:
install.packages("rJava", type = 'source')
On Arch Linux, I needed to install openjdk-src to get a JNI path working.
In other words, these are the packages I needed to install before sudo R CMD javareconf ran successfully:
local/jdk-openjdk 14.0.2.u12-1
OpenJDK Java 14 development kit
local/jre-openjdk 14.0.2.u12-1
OpenJDK Java 14 full runtime environment
local/jre-openjdk-headless 14.0.2.u12-1
OpenJDK Java 14 headless runtime environment
local/openjdk-src 14.0.2.u12-1
OpenJDK Java 14 sources
Assuming you have sudo privileges and not in Ubuntu where package manager makes this easier -- I tried variations of prior answers and found this gem on Databricks blog for nonUbuntu (https://kb.databricks.com/r/install-rjava-rjdbc-libraries.html)
Installed JDK
sudo apt-get install openjdk-8-jdk
Verify path to libjvm.so; for me-->
cd /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64
grep -r libjvm
output:
Binary file server/libjvm.so matches <<<<<<<<
Do java configure
sudo R CMD javareconf
Remove prior versions of the package and install 'rJava' from CRAN mirror in RStudio
Restart RStudio
In RStudio verify link to libjvm.so
dyn.load('/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so')
library('rJava')
I've encountered similar problem on Ubuntu 16.04 and was able to solve it by creating a folder named "default-java" in /usr/lib/jvm and copying into it all the contents of the /usr/lib/jvm/java-8-oracle. I opted for this solution as correcting JAVA_HOME environment variable turned out to be of no use.

Resources