Install R 3.5.2 under Ubuntu: “jni.h: No such file or directory”












1















I have a problem with installing the newest version of R, an error "fatal error: jni.h: No such file or directory" that I don't understand appeared.
Here is what I did before getting an error in the installation of R :



#download tar.gz file
https://cran.r-project.org/
#install because we need it for execution of "make"
sudo apt-get install libx11-dev
sudo apt-get install xorg-dev
sudo apt-get install libcurl4-openssl-dev
# decompile
# on terminal
./configure
make


What appeared to me at the end of the installation after installing libraries was this (can't paste everything because it is too long):



installing to /home/fafnyr/R/R-3.5.2/library/mgcv/libs
** R
** data
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (mgcv)
make[2]: Leaving directory '/home/fafnyr/R/R-3.5.2/src/library/Recommended'
make[1]: Leaving directory '/home/fafnyr/R/R-3.5.2/src/library/Recommended'
make[1]: Entering directory '/home/fafnyr/R/R-3.5.2/src/library'
building/updating vignettes for package 'grid' ...
building/updating vignettes for package 'parallel' ...
building/updating vignettes for package 'utils' ...
make[1]: Leaving directory '/home/fafnyr/R/R-3.5.2/src/library'
make[1]: Entering directory '/home/fafnyr/R/R-3.5.2'
configuring Java ...
Java interpreter : /usr/bin/java
Java version : 10.0.2
Java home path : /usr/lib/jvm/java-11-openjdk-amd64
Java compiler : not present
Java headers gen.:
Java archive tool:

trying to compile and link a JNI program
detected JNI cpp flags :
detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
make[2]: Entering directory '/tmp/Rjavareconf.VwU72a'
gcc -I"/home/fafnyr/R/R-3.5.2/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -c conftest.c -o conftest.o
conftest.c:1:10: fatal error: jni.h: No such file or directory
#include <jni.h>
^~~~~~~
compilation terminated.
/home/fafnyr/R/R-3.5.2/etc/Makeconf:162: recipe for target 'conftest.o' failed
make[2]: *** [conftest.o] Error 1
make[2]: Leaving directory '/tmp/Rjavareconf.VwU72a'
Unable to compile a JNI program


JAVA_HOME : /usr/lib/jvm/java-11-openjdk-amd64
Java library path:
JNI cpp flags :
JNI linker flags :
Updating Java configuration in /home/fafnyr/R/R-3.5.2
Done.

make[1]: Leaving directory '/home/fafnyr/R/R-3.5.2'









share|improve this question

























  • Seems like this question addresses the issue on Stack Overflow.

    – JakeGould
    Feb 11 at 15:58
















1















I have a problem with installing the newest version of R, an error "fatal error: jni.h: No such file or directory" that I don't understand appeared.
Here is what I did before getting an error in the installation of R :



#download tar.gz file
https://cran.r-project.org/
#install because we need it for execution of "make"
sudo apt-get install libx11-dev
sudo apt-get install xorg-dev
sudo apt-get install libcurl4-openssl-dev
# decompile
# on terminal
./configure
make


What appeared to me at the end of the installation after installing libraries was this (can't paste everything because it is too long):



installing to /home/fafnyr/R/R-3.5.2/library/mgcv/libs
** R
** data
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (mgcv)
make[2]: Leaving directory '/home/fafnyr/R/R-3.5.2/src/library/Recommended'
make[1]: Leaving directory '/home/fafnyr/R/R-3.5.2/src/library/Recommended'
make[1]: Entering directory '/home/fafnyr/R/R-3.5.2/src/library'
building/updating vignettes for package 'grid' ...
building/updating vignettes for package 'parallel' ...
building/updating vignettes for package 'utils' ...
make[1]: Leaving directory '/home/fafnyr/R/R-3.5.2/src/library'
make[1]: Entering directory '/home/fafnyr/R/R-3.5.2'
configuring Java ...
Java interpreter : /usr/bin/java
Java version : 10.0.2
Java home path : /usr/lib/jvm/java-11-openjdk-amd64
Java compiler : not present
Java headers gen.:
Java archive tool:

trying to compile and link a JNI program
detected JNI cpp flags :
detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
make[2]: Entering directory '/tmp/Rjavareconf.VwU72a'
gcc -I"/home/fafnyr/R/R-3.5.2/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -c conftest.c -o conftest.o
conftest.c:1:10: fatal error: jni.h: No such file or directory
#include <jni.h>
^~~~~~~
compilation terminated.
/home/fafnyr/R/R-3.5.2/etc/Makeconf:162: recipe for target 'conftest.o' failed
make[2]: *** [conftest.o] Error 1
make[2]: Leaving directory '/tmp/Rjavareconf.VwU72a'
Unable to compile a JNI program


JAVA_HOME : /usr/lib/jvm/java-11-openjdk-amd64
Java library path:
JNI cpp flags :
JNI linker flags :
Updating Java configuration in /home/fafnyr/R/R-3.5.2
Done.

make[1]: Leaving directory '/home/fafnyr/R/R-3.5.2'









share|improve this question

























  • Seems like this question addresses the issue on Stack Overflow.

    – JakeGould
    Feb 11 at 15:58














1












1








1








I have a problem with installing the newest version of R, an error "fatal error: jni.h: No such file or directory" that I don't understand appeared.
Here is what I did before getting an error in the installation of R :



#download tar.gz file
https://cran.r-project.org/
#install because we need it for execution of "make"
sudo apt-get install libx11-dev
sudo apt-get install xorg-dev
sudo apt-get install libcurl4-openssl-dev
# decompile
# on terminal
./configure
make


What appeared to me at the end of the installation after installing libraries was this (can't paste everything because it is too long):



installing to /home/fafnyr/R/R-3.5.2/library/mgcv/libs
** R
** data
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (mgcv)
make[2]: Leaving directory '/home/fafnyr/R/R-3.5.2/src/library/Recommended'
make[1]: Leaving directory '/home/fafnyr/R/R-3.5.2/src/library/Recommended'
make[1]: Entering directory '/home/fafnyr/R/R-3.5.2/src/library'
building/updating vignettes for package 'grid' ...
building/updating vignettes for package 'parallel' ...
building/updating vignettes for package 'utils' ...
make[1]: Leaving directory '/home/fafnyr/R/R-3.5.2/src/library'
make[1]: Entering directory '/home/fafnyr/R/R-3.5.2'
configuring Java ...
Java interpreter : /usr/bin/java
Java version : 10.0.2
Java home path : /usr/lib/jvm/java-11-openjdk-amd64
Java compiler : not present
Java headers gen.:
Java archive tool:

trying to compile and link a JNI program
detected JNI cpp flags :
detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
make[2]: Entering directory '/tmp/Rjavareconf.VwU72a'
gcc -I"/home/fafnyr/R/R-3.5.2/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -c conftest.c -o conftest.o
conftest.c:1:10: fatal error: jni.h: No such file or directory
#include <jni.h>
^~~~~~~
compilation terminated.
/home/fafnyr/R/R-3.5.2/etc/Makeconf:162: recipe for target 'conftest.o' failed
make[2]: *** [conftest.o] Error 1
make[2]: Leaving directory '/tmp/Rjavareconf.VwU72a'
Unable to compile a JNI program


JAVA_HOME : /usr/lib/jvm/java-11-openjdk-amd64
Java library path:
JNI cpp flags :
JNI linker flags :
Updating Java configuration in /home/fafnyr/R/R-3.5.2
Done.

make[1]: Leaving directory '/home/fafnyr/R/R-3.5.2'









share|improve this question
















I have a problem with installing the newest version of R, an error "fatal error: jni.h: No such file or directory" that I don't understand appeared.
Here is what I did before getting an error in the installation of R :



#download tar.gz file
https://cran.r-project.org/
#install because we need it for execution of "make"
sudo apt-get install libx11-dev
sudo apt-get install xorg-dev
sudo apt-get install libcurl4-openssl-dev
# decompile
# on terminal
./configure
make


What appeared to me at the end of the installation after installing libraries was this (can't paste everything because it is too long):



installing to /home/fafnyr/R/R-3.5.2/library/mgcv/libs
** R
** data
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (mgcv)
make[2]: Leaving directory '/home/fafnyr/R/R-3.5.2/src/library/Recommended'
make[1]: Leaving directory '/home/fafnyr/R/R-3.5.2/src/library/Recommended'
make[1]: Entering directory '/home/fafnyr/R/R-3.5.2/src/library'
building/updating vignettes for package 'grid' ...
building/updating vignettes for package 'parallel' ...
building/updating vignettes for package 'utils' ...
make[1]: Leaving directory '/home/fafnyr/R/R-3.5.2/src/library'
make[1]: Entering directory '/home/fafnyr/R/R-3.5.2'
configuring Java ...
Java interpreter : /usr/bin/java
Java version : 10.0.2
Java home path : /usr/lib/jvm/java-11-openjdk-amd64
Java compiler : not present
Java headers gen.:
Java archive tool:

trying to compile and link a JNI program
detected JNI cpp flags :
detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
make[2]: Entering directory '/tmp/Rjavareconf.VwU72a'
gcc -I"/home/fafnyr/R/R-3.5.2/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -c conftest.c -o conftest.o
conftest.c:1:10: fatal error: jni.h: No such file or directory
#include <jni.h>
^~~~~~~
compilation terminated.
/home/fafnyr/R/R-3.5.2/etc/Makeconf:162: recipe for target 'conftest.o' failed
make[2]: *** [conftest.o] Error 1
make[2]: Leaving directory '/tmp/Rjavareconf.VwU72a'
Unable to compile a JNI program


JAVA_HOME : /usr/lib/jvm/java-11-openjdk-amd64
Java library path:
JNI cpp flags :
JNI linker flags :
Updating Java configuration in /home/fafnyr/R/R-3.5.2
Done.

make[1]: Leaving directory '/home/fafnyr/R/R-3.5.2'






linux ubuntu java r makefile






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 12 at 9:23









slhck

163k47449473




163k47449473










asked Feb 11 at 15:47









Aimeric DabinAimeric Dabin

162




162













  • Seems like this question addresses the issue on Stack Overflow.

    – JakeGould
    Feb 11 at 15:58



















  • Seems like this question addresses the issue on Stack Overflow.

    – JakeGould
    Feb 11 at 15:58

















Seems like this question addresses the issue on Stack Overflow.

– JakeGould
Feb 11 at 15:58





Seems like this question addresses the issue on Stack Overflow.

– JakeGould
Feb 11 at 15:58










1 Answer
1






active

oldest

votes


















1














For this problem, I found the solution:



sudo apt install default-jdk


For the makefile, I also had some problem so I installed this:



sudo apt-get install libx11-dev
sudo apt-get install xorg-dev
sudo apt-get install libcurl4-openssl-dev


Moreover for the installation of 3.5.2, I followed those instructions:




Install the packages necessary to add a new repository over HTTPS:



  sudo apt install apt-transport-https software-properties-common


Enable the CRAN repository and add the CRAN GPG key to your system using the following commands:



  sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'


Now that the repository is added, update the packages list and install the R package by typing:



sudo apt update
sudo apt install r-base


To verify that the installation was successful run the following command which will print the R version:



  R --version
# or #
sudo -i R






share|improve this answer


























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1404488%2finstall-r-3-5-2-under-ubuntu-jni-h-no-such-file-or-directory%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    For this problem, I found the solution:



    sudo apt install default-jdk


    For the makefile, I also had some problem so I installed this:



    sudo apt-get install libx11-dev
    sudo apt-get install xorg-dev
    sudo apt-get install libcurl4-openssl-dev


    Moreover for the installation of 3.5.2, I followed those instructions:




    Install the packages necessary to add a new repository over HTTPS:



      sudo apt install apt-transport-https software-properties-common


    Enable the CRAN repository and add the CRAN GPG key to your system using the following commands:



      sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
    sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'


    Now that the repository is added, update the packages list and install the R package by typing:



    sudo apt update
    sudo apt install r-base


    To verify that the installation was successful run the following command which will print the R version:



      R --version
    # or #
    sudo -i R






    share|improve this answer






























      1














      For this problem, I found the solution:



      sudo apt install default-jdk


      For the makefile, I also had some problem so I installed this:



      sudo apt-get install libx11-dev
      sudo apt-get install xorg-dev
      sudo apt-get install libcurl4-openssl-dev


      Moreover for the installation of 3.5.2, I followed those instructions:




      Install the packages necessary to add a new repository over HTTPS:



        sudo apt install apt-transport-https software-properties-common


      Enable the CRAN repository and add the CRAN GPG key to your system using the following commands:



        sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
      sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'


      Now that the repository is added, update the packages list and install the R package by typing:



      sudo apt update
      sudo apt install r-base


      To verify that the installation was successful run the following command which will print the R version:



        R --version
      # or #
      sudo -i R






      share|improve this answer




























        1












        1








        1







        For this problem, I found the solution:



        sudo apt install default-jdk


        For the makefile, I also had some problem so I installed this:



        sudo apt-get install libx11-dev
        sudo apt-get install xorg-dev
        sudo apt-get install libcurl4-openssl-dev


        Moreover for the installation of 3.5.2, I followed those instructions:




        Install the packages necessary to add a new repository over HTTPS:



          sudo apt install apt-transport-https software-properties-common


        Enable the CRAN repository and add the CRAN GPG key to your system using the following commands:



          sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
        sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'


        Now that the repository is added, update the packages list and install the R package by typing:



        sudo apt update
        sudo apt install r-base


        To verify that the installation was successful run the following command which will print the R version:



          R --version
        # or #
        sudo -i R






        share|improve this answer















        For this problem, I found the solution:



        sudo apt install default-jdk


        For the makefile, I also had some problem so I installed this:



        sudo apt-get install libx11-dev
        sudo apt-get install xorg-dev
        sudo apt-get install libcurl4-openssl-dev


        Moreover for the installation of 3.5.2, I followed those instructions:




        Install the packages necessary to add a new repository over HTTPS:



          sudo apt install apt-transport-https software-properties-common


        Enable the CRAN repository and add the CRAN GPG key to your system using the following commands:



          sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
        sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'


        Now that the repository is added, update the packages list and install the R package by typing:



        sudo apt update
        sudo apt install r-base


        To verify that the installation was successful run the following command which will print the R version:



          R --version
        # or #
        sudo -i R







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Feb 12 at 9:22









        slhck

        163k47449473




        163k47449473










        answered Feb 12 at 9:16









        Aimeric DabinAimeric Dabin

        162




        162






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1404488%2finstall-r-3-5-2-under-ubuntu-jni-h-no-such-file-or-directory%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to make a Squid Proxy server?

            Is this a new Fibonacci Identity?

            19世紀