I cant find anything related to my question
I tried below docker file
RUN apt-get update && apt-get install -y \
software-properties-common
RUN apt-get update && \
apt-cache search openjdk && \
apt-get install openjdk-8-jdk && \
apt-get clean;
RUN apt-get update && \
apt-get install ca-certificates-java && \
apt-get clean && \
update-ca-certificates -f;
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
RUN export JAVA_HOME
#tabula.errors.JavaNotFoundError: `java` command is not found from this Python
#process.Please ensure Java is installed and PATH is set for `java`
when i use import tabula im getting tabula.errors.JavaNotFoundError. can someone please help what to do to get rid of this error in docker ?
UPDATE:
Im using flask and mongodb. in flask there is a code responsible to read pdf files which is tabula and it needs Java as it says in its error. for other python package i installed with pipfile and pipfile.lock
RUN pip install pipenv
COPY Pipfile . #<---- contains tabula package
COPY Pipfile.lock . #<---- contains tabula package
RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy
##But i have no idea how to install java for tabula dependecy.
**************** FINAL UPDATE *****************
I replaced tabula with pdfplumber. now working good, thanks for all who tried to help me.
Generally one should refrain from using a container image with more than one main process, such as python and java, and I would personally advise finding a replacement to tabula-py that doesn't require a java enviroment for that is the best practice when using containers as specified here as so:
It is generally recommended that you separate areas of concern by using one service per container.
With that in mind, because I don't know if you can do those things I'm gonna provide an alternative as well.
this docker image packs multiple runnable environments into one such as java and python, and its dockerfile is listed here.
Because it encompasses more environments than you need you can slim it down to your needs.
there is also this project though it wasn't updated for awhile or this article describing a consise homebrewed python and java dockerfile
In case anyone is trying to achieve that and doesn't want to switch to another library, here is a way of making it work with Tabula.
By the way, here I'm using Tabula in jupyter notebook... but you just have to change the image from Jupyter to python to achieve what you want with Flask.
Your docker-compose will be like this:
jupyter:
container_name: jupyter_lab
build: .
ports:
- "8888:8888"
environment:
- JUPYTER_ENABLE_LAB=yes
volumes:
- ./work:/home/jovyan/work
This is your Dockerfile:
# Image base-notebook
FROM jupyter/minimal-notebook #getting the basic one.
# Change to root user to install java 8
USER root
# Install java 8
RUN apt-get update \
&& echo "Updated apt-get" \
&& apt-get install -y openjdk-8-jre \
&& echo "Installed openjdk 8"
# Install requirements
COPY requirements.txt ./
RUN pip3 install -r requirements.txt
RUN rm -rf requirements.txt
# Change to "$NB_USER" command so the image runs as a non root user by default
USER $NB_UID
Your requirements.txt
tabula.py
Create the folder "work" (that is the folder that is going to be synced with the container).
Now open the terminal and type docker-compose up --build
This command will build and start your container. With these steps, you should be ready to go.
Test with this line of code in the notebook:
from tabula import read_pdf
pdf = read_pdf("path_to_your_pdf.pdf", pages='all')
I am trying to install the 'rJava' package in my RStudio docker image using my Dockerfile:
FROM rocker/tidyverse:3.6.1
RUN mkdir -p /rstudio
RUN mkdir -p /rscripts
RUN apt-get update && \
apt-get install -y openjdk-11-jdk && \
apt-get install -y liblzma-dev && \
apt-get install -y libbz2-dev
RUN R -e "install.packages(c('rJava','mailR'))"
Following this SO post I added the above part with the apt-get commands but still I get the same error:
java libs :
'-L/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server -ljvm'
checking whether Java run-time works... ./configure: line 3766:
/usr/bin/java: No such file or directory no configure: error: Java
interpreter '/usr/bin/java' does not work ERROR: configuration failed
for package ‘rJava’
So there is a missing file or directory but I don't know what changes I should make.
[EDIT 1]:
So, following Dirk's suggestion, I entered in the rstudio container and ran apt-get install r-cran-rjava which seems to work.
But when I install rJava package I get a new error:
error: Cannot compile a simple JNI program. Make sure you have Java
Development Kit installed and correctly registered in R. If in doubt,
re-run "R CMD javareconf" as root.
I tried to enter again in the container and run R CMD javareconf but that did not change the error. I also tried the following commands found on this article:
sudo apt-get install default-jre
sudo apt-get install default-jdk
But I still get:
Cannot compile a simple JNI program.
I found a github repo suggesting to add these steps in the Dockerfile before installing R package rJava and it worked:
RUN apt-get -y update && apt-get install -y \
default-jdk \
r-cran-rjava \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/
This is a duplicate of similar answers I have already given in the Debian / Ubuntu context. The fact that you are using Docker does not matter: you should still simply install the binary!
edd#rob:~$ docker run --rm -ti r-base bash
root#ef4bb9726a21:/# apt update -qq
73 packages can be upgraded. Run 'apt list --upgradable' to see them.
root#ef4bb9726a21:/# apt install --no-install-recommends -y r-cran-rjava
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
ca-certificates-java default-jre default-jre-headless java-common libasound2 libasound2-data libavahi-client3 libavahi-common-data libavahi-common3 libcups2 libdbus-1-3 libdrm-amdgpu1 libdrm-common
libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2 libedit2 libgif7 libgl1 libgl1-mesa-dri libglapi-mesa libglvnd0 libglx-mesa0 libglx0 liblcms2-2 libllvm10 libnspr4 libnss3 libpciaccess0 libpcsclite1
libsensors-config libsensors5 libsqlite3-0 libvulkan1 libx11-xcb1 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-sync1 libxdamage1 libxfixes3 libxi6 libxshmfence1 libxtst6 libxxf86vm1 libz3-4
openjdk-11-jre openjdk-11-jre-headless
[.... many lines skipped ....]
Running hooks in /etc/ca-certificates/update.d...
done.
done.
root#ef4bb9726a21:/# R
R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
[...some lines skipped...]
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.
> library(rJava)
>
The reason why Dirk's answer doesn't work for you is because you're using rocker/tidyverse as a base image instead of the r-base that Dirk is using.
In the rocker/tidyverse documentation on Docker Hub they are discouraging the use of apt install --no-install-recommends -y r-cran-rjava:
do not use apt-get install r-cran-* to install R packages on this stack. The requested R version and all R packages are installed from source in the version-stable stack. Installing R packages from apt (e.g. the r-cran-* packages) will install the version of R and versions of the packages that were built for the stable debian release (e.g. debian:stretch), giving you a second version of R and different packages. Please install R packages from source using the install.packages() R function (or the install2.r script), and use apt only to install necessary system libraries (e.g. libxml2). If you would prefer to install only the latest verions of packages from pre-built binaries using apt-get, consider using the r-base stack instead.
Since rJava is supposed to be installed with apt install r-cran-rjava, but the rocker/... base images explicitly tell you not to do that, it looks like you will not be able to use rJava with any of the rocker/... base images..
I recently bought the Raspberry Pi 3 b + version, installed the Java 8 191 version and unpacked it after receiving 'eclipse-jee-2018-09-linux-gtk.tar.gz' from the Eclipse official website And when I hit the executable file, I get no response.
Why are you doing this?
Note that both 32-bit and 64-bit versions can not run.
Try installing Eclipse via apt-get:
open the terminal and run these commands:
sudo apt-get update
sudo apt-get install eclipse
once the installation is over and went without errors you should see the Eclipse icon under the programming section of the start menu.
In case you want to use the EE and the tar ball.
Open the terminal and locate the tar.gz file.
I'm assuming you are going to install it on /usr/local
then do:
cd /usr/local
sudo tar xzvf eclipse-jee-2018-09-linux-gtk.tar.gz
cd /usr/bin
sudo ln -s /usr/local/eclipse/eclipse
To make sure it works:
ls -ld /usr/bin/eclipse
You should get something like /usr/bin/eclipse -> /usr/local/eclipse/eclipse
Now you should be able to create a shortcut or open the terminal and type:
eclipse&
To load it.
Tell me how it goes.
I'm new to Ubuntu and Linux in general. I want to code in Java on my computer, but I'm having problems installing IntelliJ IDEA on Ubuntu. I have downloaded and extracted the file and for some reason renamed the folder to idea. I tried moving the folder to /usr/share/applications or something but I didn't have permission. I used sudo -i in terminal to gain permission but didn't manage to get out of root folder. Can anyone help me with a step by step way to move the folder, create a shortcut in the search bar or whatever it's called and install it properly?
Note: This answer covers the installation of IntelliJ IDEA. For an extended script, that covers more JetBrains IDEs, as well as help for font rendering issues, please see this link provided by brendan.
Furthermore, a manual Desktop Entry creation is optional, as newer versions of IntelliJ offer to create it on first startup.
I have my intellij int /opt folder. So what I do is:
Download Intellij
Extract intellij to /opt-folder: sudo tar -xvf <intellij.tar> -C /opt/ (the -C option extracts the tar to the folder /opt/)
Create a Desktop Entry File called idea.desktop (see example file below) and store it anywhere you want (let's assume in your home directory)
Move the idea.desktop from your home directory to /usr/share/applications: sudo mv ~/idea.desktop /usr/share/applications/
Now (in a lot) Ubuntu versions you can start the application after the GUI is restarted. If you don't know how to do that, you can restart your PC..
idea.desktop (this is for community edition version 14.1.2, you have to change the paths in Exec= and Icon= lines if the path is different for you):
[Desktop Entry]
Encoding=UTF-8
Name=IntelliJ IDEA
Comment=IntelliJ IDEA
Exec=/opt/ideaIC-14.1.2/bin/idea.sh
Icon=/opt/ideaIC-14.1.2/bin/idea.png
Terminal=false
StartupNotify=true
Type=Application
Edit
I also found a shell script that does this for you, here. The given script in the link installs Oracle Java 7 for you and gives you the choice between Community and Ultimate Edition. It then automatically downloads the newest version for you, extracts it and creates a desktop entry.
I have modified the scripts to fulfill my needs. It does not install java 8 and it does not ask you for the version you want to install (but the version is kept in a variable to easily change that). You can also update Intellij with it. But then you have to (so far) manually remove the old folder! This is what i got:
Edit2
Here is the new version of the script. As mentioned in the comments, breandan has updated the script to be more stable (the jetbrains website changed its behavior). Thanks for the update, breandan.
#!/bin/sh
echo "Installing IntelliJ IDEA..."
# We need root to install
[ $(id -u) != "0" ] && exec sudo "$0" "$#"
# Attempt to install a JDK
# apt-get install openjdk-8-jdk
# add-apt-repository ppa:webupd8team/java && apt-get update && apt-get install oracle-java8-installer
# Prompt for edition
#while true; do
# read -p "Enter 'U' for Ultimate or 'C' for Community: " ed
# case $ed in
# [Uu]* ) ed=U; break;;
# [Cc]* ) ed=C; break;;
# esac
#done
ed=C
# Fetch the most recent version
VERSION=$(wget "https://www.jetbrains.com/intellij-repository/releases" -qO- | grep -P -o -m 1 "(?<=https://www.jetbrains.com/intellij-repository/releases/com/jetbrains/intellij/idea/BUILD/)[^/]+(?=/)")
# Prepend base URL for download
URL="https://download.jetbrains.com/idea/ideaI$ed-$VERSION.tar.gz"
echo $URL
# Truncate filename
FILE=$(basename ${URL})
# Set download directory
DEST=~/Downloads/$FILE
echo "Downloading idea-I$ed-$VERSION to $DEST..."
# Download binary
wget -cO ${DEST} ${URL} --read-timeout=5 --tries=0
echo "Download complete!"
# Set directory name
DIR="/opt/idea-I$ed-$VERSION"
echo "Installing to $DIR"
# Untar file
if mkdir ${DIR}; then
tar -xzf ${DEST} -C ${DIR} --strip-components=1
fi
# Grab executable folder
BIN="$DIR/bin"
# Add permissions to install directory
chmod -R +rwx ${DIR}
# Set desktop shortcut path
DESK=/usr/share/applications/IDEA.desktop
# Add desktop shortcut
echo -e "[Desktop Entry]\nEncoding=UTF-8\nName=IntelliJ IDEA\nComment=IntelliJ IDEA\nExec=${BIN}/idea.sh\nIcon=${BIN}/idea.png\nTerminal=false\nStartupNotify=true\nType=Application" -e > ${DESK}
# Create symlink entry
ln -s ${BIN}/idea.sh /usr/local/bin/idea
echo "Done."
Old Version
#!/bin/sh
echo "Installing IntelliJ IDEA..."
# We need root to install
[ $(id -u) != "0" ] && exec sudo "$0" "$#"
# define version (ultimate. change to 'C' for Community)
ed='U'
# Fetch the most recent community edition URL
URL=$(wget "https://www.jetbrains.com/idea/download/download_thanks.jsp?edition=I${ed}&os=linux" -qO- | grep -o -m 1 "https://download.jetbrains.com/idea/.*gz")
echo "URL: ${URL}"
echo "basename(url): $(basename ${URL})"
# Truncate filename
FILE=$(basename ${URL})
echo "File: ${FILE}"
# Download binary
wget -cO /tmp/${FILE} ${URL} --read-timeout=5 --tries=0
# Set directory name
DIR="${FILE%\.tar\.gz}"
# Untar file
if mkdir /opt/${DIR}; then
tar -xvzf /tmp/${FILE} -C /opt/${DIR} --strip-components=1
fi
# Grab executable folder
BIN="/opt/$DIR/bin"
# Add permissions to install directory
chmod 755 ${BIN}/idea.sh
# Set desktop shortcut path
DESK=/usr/share/applications/IDEA.desktop
# Add desktop shortcut
echo -e "[Desktop Entry]\nEncoding=UTF-8\nName=IntelliJ IDEA\nComment=IntelliJ IDEA\nExec=${BIN}/idea.sh\nIcon=${BIN}/idea.png\nTerminal=false\nStartupNotify=true\nType=Application" > ${DESK}
echo "Done."
You can also try my ubuntu repository: https://launchpad.net/~mmk2410/+archive/ubuntu/intellij-idea
To use it just run the following commands:
sudo apt-add-repository ppa:mmk2410/intellij-idea
sudo apt-get update
The community edition can then installed with
sudo apt-get install intellij-idea-community
and the ultimate edition with
sudo apt-get install intellij-idea-ultimate
JetBrains has a new application called the Toolbox App which quickly and easily installs any JetBrains software you want, assuming you have the license. It also manages your login once to apply across all JetBrains software, a very useful feature.
To use it, download the tar.gz file here, then extract it and run the included executable jetbrains-toolbox. Then sign in, and press install next to IntelliJ IDEA:
If you want to move the executable to /usr/bin/ feel free, however it works fine out of the box wherever you extract it to.
This will also make the appropriate desktop entries upon install.
Since Ubuntu 18.04 installing Intellij IDEA is easy! You just need to search "IDEA" in Software Center. Also you're able to choose a branch to install (I use EAP).
For earlier versions:
According to this (snap) and this (umake) articles the most comfortable ways are:
to use snap-packages (since versions IDEA 2017.3 & Ubuntu 14.04):
install snapd system. Since Ubuntu 16.04 you already have it.
install IDEA snap-package or even EAP build
to use ubuntu-make
(for Ubuntu versions earlier than 16.04 use apt-get command instead apt):
Add PPA ubuntu-desktop/ubuntu-make (if you install ubuntu-make from standard repo you'll see only a few IDE's):
$ sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make
Install ubuntu-make:
$ sudo apt update
$ sudo apt install ubuntu-make
install preffered ide (IDEA, for this question):
$ umake ide idea
or even ultimate version if you need:
$ umake ide idea-ultimate
I upgrade Intellij IDEA via reinstalling it:
$ umake -r ide idea-ultimate
$ umake ide idea-ultimate
TL;DR:
Download IntelliJ IDEA from here.
cd Downloads
extract the downloaded file: sudo tar xf ideaIC-2017.2.5.tar.gz -C /opt/
Switch to the bin directory: cd /opt/idea-IC-172.4343.14/bin
Run idea.sh from the bin subdirectory.
Since Ubuntu 16.04 includes snapd by default.
So, the easiest way to install the stable version is
IntelliJ IDEA Community:
$ sudo snap install intellij-idea-community --classic
IntelliJ IDEA Ultimate:
$ sudo snap install intellij-idea-ultimate --classic
For the latest version use channel --edge
$ sudo snap install intellij-idea-community --classic --edge
Here is the list of all channels https://snapcraft.io/intellij-idea-ultimate (drop down 'All versions').
options
--classic
The --classic option is required because the IntelliJ IDEA snap requires full access to the system, like a traditionally packaged application.
[https://www.jetbrains.com/help/idea/install-and-set-up-product.html#install-on-linux-with-snaps]
--edge
--edge Install from the edge channel
[http://manpages.ubuntu.com/manpages/bionic/man1/snap.1.html]
Note: Snap, also work a few major distributions: Arch, Debian, Fedora, openSUSE, Linux Mint,...
Recent IntelliJ versions allows automatic creation of desktop entry. See this gist
Launch from commandline. If launching for the first time, setup will ask about creating a desktop launcher icon; say yes. Or else after launching (ie. from the commandline) any time, use the IDEA menu Configure > Create Desktop Entry . That should create /usr/share/applications/intellij-idea-community.desktop
Trigger the Ubuntu desktop search (ie. Windows key), find the Intellij IDEA you used to create the desktop entry.
Drag the icon it's showing into the Ubuntu Launcher.
In a simple manner you can also try to just run a pre-packaged docker with intellij, I found the good job of #dlsniper : https://hub.docker.com/r/dlsniper/docker-intellij/
you just need to have docker installed and to run :
docker run -tdi \
--net="host" \
--privileged=true \
-e DISPLAY=${DISPLAY} \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v ${HOME}/.IdeaIC2016.1_docker:/home/developer/.IdeaIC2016.1 \
-v ${GOPATH}:/home/developer/go \
dlsniper/docker-intellij
Standalone installation
Download the tarball.tar.gz.
Extract the tarball to a directory that supports file execution.
For example, to extract it to the recommended /opt directory, run the following command:
sudo tar -xzf ideaIC-2020.3.tar.gz -C /opt
Go to /opt folder and open intellij folder
Go to /bin folder and execute the command sh idea.sh
Now the application opened and create the desktop shortcut if you need
I find and follow this youtube:
https://www.youtube.com/watch?v=PbW-doAiAvI
Basically, download the tar.gz package, extract into /opt/, and then run the "idea.sh" under bin folder (i.e. /opt/idea-IC-163.7743.44/bin/idea.sh)
Enjoy
I needed to install various JetBrains tools on a number of machines from CLI, so I wrote a tiny tool to help with that. It also uses cleaner APIs from JB making it hopefully more stable, and works for various JB tools.
Feel free to try it: https://github.com/MarcinZukowski/jetbrains-installer
try simple way to install intellij idea
Install IntelliJ on Ubuntu using Ubuntu Make
You need to install Ubuntu Make first. If you are using Ubuntu 16.04, 18.04 or a higher version, you can install Ubuntu Make using the command below:
sudo apt install ubuntu-make
Once you have Ubuntu Make installed, you can use the command below to install IntelliJ IDEA Community edition:
umake ide idea
To install the IntelliJ IDEA Ultimate edition, use the command below:
umake ide idea-ultimate
To remove IntelliJ IDEA installed via Ubuntu Make, use the command below for your respective versions:
umake -r ide idea
umake -r ide idea-ultimate
you may visit for more option.
https://itsfoss.com/install-intellij-ubuntu-linux/
I have been using django-pipeline successfully for a couple of months. Now I have installed virtual-env for the first time on a clean system. Everything is accordingly set and all pip installs are done within my environment.
python manage.py collectstatic
Now I get an error when I am collecting my static files, it says
File "/vc/cb-env/local/lib/python2.7/site-packages/pipeline/compressors/__init__.py", line 247, in execute_command
raise CompressorError(error)
pipeline.compressors.CompressorError: [warning] /usr/bin/yui-compressor: No java runtime was found
[warning] /usr/bin/yui-compressor: No JAVA_CMD set for run_java, falling back to JAVA_CMD = java
Even though both yui-compressor as well as latest java were installed previously:
sudo add-apt-repository ppa:webupd8team/java -y
sudo apt-get update
sudo apt-get install oracle-java7-installer -y
sudo apt-get install yui-compressor -y
By the look of it, because I had installed java as root, my environment doesn't seem to find it.
What can I do?
Not a direct solution but after some research and chat with the maker of django-pipeline it seems that Yui-Compressor is deprecated anyway and replaced by Yuglify.
Hence its best to keep the django settings.py as it is and simply install Yuglify instead.
sudo apt-get install npm
(switch your virtualenv's environment)
npm install yuglify
The settings.py needs to change only one line:
PIPELINE_YUI_BINARY = '/vc/{your-project-env}/site/{your-project}/node_modules/yuglify/bin/yuglify'
Thats it and it works.
UPDATE:
In the latest django-pipeline You can't set the YUI binary to Yuglify anymore.
You have explicitely declare the yuglify binary. But otherwise nothing changes:
PIPELINE_YUGLIFY_BINARY = "/vc/{yourproject-env}/node_modules/yuglify/bin/yuglify"