Install java on Libreelec

  • Hi,


    I would like to run an application in the background of Libreelec that requires java. Can anyone advice me on how to install it?


    I am using an HTPC with AMD Athlon 5350 processor. Which version of Java is suitable for me?

  • You can't install Java in the easy way as there is no apt-get for LibreELEC. LibreELEC is a read only system, which means you can't install anything (beside addons). You have to compile LibreELEC for yourself and add the packages you need. So, best practice is, clone your own LE build from git and start changing the things you want to add.


    If you can't do that (because of the lack of knowledge) some other OS might probably be a better choice, tbh.


  • Hi,


    I would like to run an application in the background of Libreelec that requires java. Can anyone advice me on how to install it?


    I am using an HTPC with AMD Athlon 5350 processor. Which version of Java is suitable for me?


    Which application?

  • Install java, install JDownloader, add start to autoexec.sh or make systemd script. This addon was already done years back for openelec. What a great times...

    Gone...

  • JDownloader is the application


    I have a docker image for that: docker-jdownloader2


    EDIT: Specifically, you can use the following from command line to set up the container and have it autostart:


    docker run -d --name=jd2 -v /storage/downloads/:/downloads -v /storage/.kodi/userdata/addon_data/jdownloader:/config -e TZ=America/New_York -p 8080:8080 aptalca/docker-jdownloader2


    Replace the TZ value with your timezone if different: List of tz database time zones - Wikipedia


    Give it a minute or two, and then go to yourLibreELECIPaddress:8080 from any browser and you should see jd2


    In the settings, you can set the download location to "/downloads", which should be mapped to "/storage/downloads" on LE, which you can also access through samba

    Edited once, last by aptalca ().



  • hi aptalca,


    thanks a lot for sharing your jd-container and the "manual" to use it. :exclamation:
    I´m running libreelec with the goal to have a running docker container of jdownloader2 on it.
    I have downloaded the docker container via the given pull command.
    Then I modified the download port to 8000 and i was able to access the jdownloader via webgui. (the rest of the command is exactly the same like yours)
    I managed to find the "trick" with the clipboard (alt + ctrl + shift) and configured the jdwonloader settings as i use with other operation systems (with proxy settings and accounts).


    The problem is that jdownloader gives me an error-message regarding the downloadpath ("/downloads") which is mapped like you advices to "/storage/downloads"
    Error: "invalid download-path" :huh:


    If the standard downloads path is going to work fine i would want to download to an external harddrive connected via USB afterwards (/var/media/TOSHIBA_EXT/jdown).
    :arrow: Libreelec makes an automount to /var/media/TOSHIBA_EXT.


    Now to my second question: how i can start the jd-container and "re-use" it on every reboot/startup of libreelec because you said sth. like autostart ? I have red during web-research that other containers are autostarted as system.d service. Is this possible with your container, too?

  • I see, it's a permission issue.


    On LE, everything is owned by root, but this container runs as 99:100 (nobody:users in ubuntu). If you do a "chown 99:100 /storage/downloads" that should take care of it.


    You should also be able to use the other location as well. Just make sure the permissions are set correctly.


    For start on boot, there are multiple options. I guess the easiest is to add the following parameter to the docker run command: "--restart=always" somewhere in the middle


    In the meantime, I'll look into how to change the user of jd2 so permissions would no longer be an issue. There was a way, but can't remember, lol


  • Hi and thank you for your quick reply,


    you mentioned the command chown 99:100 ... . I'm right that i have to set the permissions of the download directory in LE to "99:100" or is this a issue of the container because there are not "enough" rights? I don't know whether you mean in LE over SSH or as command in the container. If it is a issue for the container i have no idea how the changes could be done. :rolleyes:
    Thanks again, great work!


    P.S. you may allready know that I'm not a native speaker/writer. I'm from Germany and i'm going to continue playing arround with LE after my work.


  • Hi and thank you for your quick reply,


    you mentioned the command chown 99:100 ... . I'm right that i have to set the permissions of the download directory in LE to "99:100" or is this a issue of the container because there are not "enough" rights? I don't know whether you mean in LE over SSH or as command in the container. If it is a issue for the container i have no idea how the changes could be done. :rolleyes:
    Thanks again, great work!


    P.S. you may allready know that I'm not a native speaker/writer. I'm from Germany and i'm going to continue playing arround with LE after my work.


    Either way would work. Changing permissions in LE is easier.


    The owner of that folder's user id number would be 99:100 both inside and outside of the container. Just the user name would look different. Inside the container, 99 corresponds to user nobody, but in LE (outside the container) 99 doesn't correspond to a user name so it would just show 99.


    The problem was that the downloads folder was owned by root, and user 99(nobody) inside the container did not have permissions to write to it.

    Edited once, last by aptalca ().


  • Either way would work. Changing permissions in LE is easier.


    The owner of that folder's user id number would be 99:100 both inside and outside of the container. Just the user name would look different. Inside the container, 99 corresponds to user nobody, but in LE (outside the container) 99 doesn't correspond to a user name so it would just show 99.


    The problem was that the downloads folder was owned by root, and user 99(nobody) inside the container did not have permissions to write to it.


    hi and thank you again!


    i tried the command you adviced:


    chown 99:100 /storage/downloads


    now i'm able to download to this path that is based on the internal disk, but if i use this for external drive (NTFS formatted filesystem) it has no effect.


    chown 99:100 /var/media/Toshiba\ EXT/jdown


    jd2 is still reporting the error: invalid download directory. I also double checked if there is enough space for downloads. Maybe it helps to show my command i used to run docker container:


    docker run -d --name=jd2 -v /var/media/Toshiba\ EXT/jdown:/downloads -v /storage/.kodi/userdata/addon_data/jdownloader:/config -e TZ=Europe/Berlin -p 8000:8080 aptalca/docker-jdownloader2


    Accessing the jd2 web GUI i'm also able to see the other folders and files that are located at the external drive in the directory "jdown"
    But no wirte access or sth. else? Even jdwonloader creates a .part file of the download file in the specific directory "/var/media/Toshiba\ EXT/jdown" that i'm able to list with the "ls" command navigating over ssh through the filesystem...


    i hope anyone can help me to fix this :-/

    Edited once, last by gonzo ().

  • Hi aptalca,


    I understand that you're one of the LinuxServer.IO team. May I request to add this JDownloder service to the LinuxServer.IO's repository for easy installation.


    Thanks.


  • Hi aptalca,


    I understand that you're one of the LinuxServer.IO team. May I request to add this JDownloder service to the LinuxServer.IO's repository for easy installation.


    Thanks.


    No downloaders allowed on the LibreELEC repo.


    Plus, although I'm on the linuxserver team, this image is one I support myself separate from the team.

  • Thanks for clarification.


    Your support here and in other threads about docker are always helpful. Very appreciated.


    Sent from my X900+ using Tapatalk

    Edited once, last by pawnthep ().


  • hello again,


    i know my issue is a little bit off-topic but i want to solve my problem and gain more linux experience. Maybe i'm not the only one who's using an external ntfs disk with libre elec + jdownloader 2 container and answering my question hopefully could help other users, too.
    As i described above i'm able to start jdownloader2 container and change the download directory for my internal ext4 filessystem but not for external (USB) nfts formatted disk. Thanks again to aptalca who helped me to figure out that it is a permission issue. I have red that it is not possible to "chwon... " a ntfs disk in libre elec because ntfs is not POSIX conform. The only point here is that sadly reformatting the ntfs disk is not an option for me.
    I also know that running a docker container as root is commonly known as a security risk.
    But for me it seems to be the only thing to get rid of the this permission issue. My idea is to change the nobody user of the container to root thus the permissions in the container and in libre elelc are the same and i'm able to save (write) the downloaded files to my external hard disk.
    It would be great anyone knows if i am right or tells me how i can achieve my goal of using a jdownloader download directory that points to a an external ntfs formatted drive...