Installing rJava package with Docker - java

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..

Related

How to install java for tabula inside docker container

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')

How to install openjdk-8-jdk on Debian 10 (Buster)?

It seems Debian does not support openjdk-8-jdk anymore due to a security issue. What is the easiest way to install openjdk-8-jdk for Debian 10 (Buster)?
Alternatively, you can use adoptopenjdk repository:
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
sudo apt-get update && sudo apt-get install adoptopenjdk-8-hotspot
https://adoptopenjdk.net/installation.html
WARNING: this answer suggest unsupported and dangerous mixing of
Debian releases. Follow the advice on your own risk, as it can break
the system on upgrades, as explained in
http://wiki.debian.org/DontBreakDebian#Don.27t_make_a_FrankenDebian
Package mirror search steps:
In the Search package directories search for openjdk-8-jdk. You can see two results:
stretch (oldstable) (java): OpenJDK Development Kit (JDK)
sid (unstable) (java): OpenJDK Development Kit (JDK)
Choose stretch repository
Scroll to the Download openjdk-8-jdk section and choose your architecture. For example amd64
Now you can see mirrors list and instructions how to install the package via apt:
You should be able to use any of the listed mirrors by adding a line
to your /etc/apt/sources.list like this:
deb http://security.debian.org/debian-security stretch/updates main
Installation steps:
Install software source manager
apt-get update
apt-get install software-properties-common
Add mirror with openjdk-8-jdk
apt-add-repository 'deb http://security.debian.org/debian-security stretch/updates main'
apt-get update
Install openjdk 8
apt-get install openjdk-8-jdk
Note: You can use steps above to find an official Debian mirror with any other package you want to install
You can search the Debian packages site and find out the openjdk-8-jdk package for Debian 10 is only available from unstable (sid) repository currently.
At first it is good to check and save current system-wide symbolic links for already installed Java SDK/JRE packages if any:
ls -la /etc/alternatives | grep java > previous-java-alternatives.txt
Then check is this package can be installed with current configuration:
apt-cache policy openjdk-8-jdk
If no then you need to add unstable repository to the sources list.
The negative output may imply that you prefer to use stable repositories and usually it isn't appropriate for you to update all other software from unstable repositories.
So before adding unstable repository to the sources list make sure APT::Default-Release configuration option is set to "stable":
grep -r Default-Release /etc/apt/
If no (as by default) then set it as recommended in that answer by creating this file:
/etc/apt/apt.conf.d/99defaultrelease
APT::Default-Release "stable";
Now you're ready to add the unstable repository to the sources list.
Before I prefer to check what mirror was selected by me when system was installed. Just look to main sources list:
cat /etc/apt/sources.list
In my case the output shows that mirror.yandex.ru server is used as system source. So I use the same for unstables and add this file:
/etc/apt/sources.list.d/91-debian-unstable.list
deb http://mirror.yandex.ru/debian/ unstable main
deb-src http://mirror.yandex.ru/debian/ unstable main
(I also have 90-debian-testing.list file for the testing repo.)
Then update package lists:
apt update
And check you system wont update from unstable sources:
apt list --upgradable
And recheck is required package can be installed:
apt-cache policy openjdk-8-jdk
Do install the package:
apt install openjdk-8-jdk
Look at new symbolic links:
ls -la /etc/alternatives | grep java-8
Just waste few seconds on them (or continue with man 1 update-alternatives).
This is my script which I use to install OpenJDK 8 on Bitbucket's Pipelines Docker image NodeJS 10.16.2.
But now I see that this docker image is based on Stretch...
It is based on https://github.com/docker-library/openjdk/blob/89851f0abc3a83cfad5248102f379d6a0bd3951a/8-jdk/Dockerfile
#!/bin/bash
set -x #echo on
# based on https://github.com/docker-library/openjdk/blob/89851f0abc3a83cfad5248102f379d6a0bd3951a/8-jdk/Dockerfile
apt-get update && apt-get install -y --no-install-recommends \
bzip2 \
unzip \
xz-utils &&
rm -rf /var/lib/apt/lists/*
echo 'deb http://httpredir.debian.org/debian-security stretch/updates main' >/etc/apt/sources.list.d/jessie-backports.list
# Default to UTF-8 file.encoding
export LANG=C.UTF-8
# add a simple script that can auto-detect the appropriate JAVA_HOME value
# based on whether the JDK or only the JRE is installed
{ \
echo '#!/bin/sh'; \
echo 'set -e'; \
echo; \
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
} > /usr/local/bin/docker-java-home \
&& chmod +x /usr/local/bin/docker-java-home
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export JAVA_VERSION=8u252
export JAVA_DEBIAN_VERSION=8u252-b09-1~deb9u1
# see https://bugs.debian.org/775775
# and https://github.com/docker-library/java/issues/19#issuecomment-70546872
export CA_CERTIFICATES_JAVA_VERSION=20170929~deb9u3
set -x \
&& apt-get update \
&& apt-get install -y \
openjdk-8-jdk="$JAVA_DEBIAN_VERSION" \
ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \
&& rm -rf /var/lib/apt/lists/* \
&& [ "$JAVA_HOME" = "$(docker-java-home)" ]
# see CA_CERTIFICATES_JAVA_VERSION notes above
/var/lib/dpkg/info/ca-certificates-java.postinst configure
UPDATE
Things change, versions are upped. Here is the latest script which works for https://hub.docker.com/layers/node/library/node/10.16.2/images/sha256-8f420c033acee137f9e902092a04d371bdf1f839559cce60614c0d5905d20294?context=explore
#!/bin/bash
set -x #echo on
# based on https://github.com/docker-library/openjdk/blob/89851f0abc3a83cfad5248102f379d6a0bd3951a/8-jdk/Dockerfile
apt-get update && apt-get install -y --no-install-recommends \
bzip2 \
unzip \
xz-utils &&
rm -rf /var/lib/apt/lists/*
echo 'deb http://httpredir.debian.org/debian-security stretch/updates main' >/etc/apt/sources.list.d/jessie-backports.list
# Default to UTF-8 file.encoding
export LANG=C.UTF-8
# add a simple script that can auto-detect the appropriate JAVA_HOME value
# based on whether the JDK or only the JRE is installed
{ \
echo '#!/bin/sh'; \
echo 'set -e'; \
echo; \
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
} > /usr/local/bin/docker-java-home \
&& chmod +x /usr/local/bin/docker-java-home
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export JAVA_VERSION=8u265
export JAVA_DEBIAN_VERSION=8u265-b01-0+deb9u1
# see https://bugs.debian.org/775775
# and https://github.com/docker-library/java/issues/19#issuecomment-70546872
export CA_CERTIFICATES_JAVA_VERSION=20170929~deb9u3
set -x \
&& apt-get update \
&& apt-get install -y \
openjdk-8-jdk="$JAVA_DEBIAN_VERSION" \
ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \
&& rm -rf /var/lib/apt/lists/* \
&& [ "$JAVA_HOME" = "$(docker-java-home)" ]
# see CA_CERTIFICATES_JAVA_VERSION notes above
/var/lib/dpkg/info/ca-certificates-java.postinst configure
I needed to install a 32-bit version but this wasn't available at adoptopenjdk far as I could see. I tracked down a copy of a binary at java.com i their downloads area:
jre-8u241-linux-i586.tar.gz
All I needed was the JRE (rather than a JDK, but the process should be the same for either) and since it was also for a personal use only, the Oracle binary was OK (they have limitations in this regard).
I downloaded the binary and placed it in the home folder (~/) of the user that needed to run it and then unzipped it like so:
mkdir ~/java && cd ~/java && tar -xf jre-8u241-linux-i586.tar.gz
Then added the location to the path of the user that would run the Java application by appending this line to ~/.profile:
export PATH=$PATH:/home/youruserid/java/jre1.8.0_241/bin
This worked fine for my case but there are no doubt better ways to install a binary. For example so it is available for all Unix users rather than just one.
The easiest way to install JDK8 is using SDKMAN.
$ curl -s "https://get.sdkman.io" | bash
$ source "$HOME/.sdkman/bin/sdkman-init.sh"
$ sdk install java 8.0.275.hs-adpt
Based one some of the above answers, this is what i used in my shell script on debian buster silm os running node 12.x (node:12.6-buster-slim)
This was in preparing to move to github actions local testing with act, do note that there is no need for sudo as ci testing in this container already is root.
apt-get update -qq
#software-properties-common not installed on slim
apt-get install software-properties-common -y -q
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | apt-key add -
add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
apt-get update -qq
#man folder needs to be available for adoptopenjdk-8 to finish configuring
mkdir -p /usr/share/man/man1/
apt-get install adoptopenjdk-8-hotspot -y
#ensure openjdk-8-jdk is found for some installations, thanks b8kich for the virtual wrapper
curl https://gitlab.com/b8kich/adopt-openjdk-8-jdk/-/raw/master/adopt-openjdk-8-jdk_0.1_all.deb?inline=false -o adopt-openjdk-8-jdk_0.1_all.deb
dpkg -i adopt-openjdk-8-jdk_0.1_all.deb
I've found, mainly after years of working with deprecated iDrac consoles which have particular java requirements, that installing multiple versions of the JRE or JDK is preferable as you can choose between them as necessary without worrying about other dependencies or breaking your package manager.
This is actually incredibly easy on Debian, and very probably other linux, by eschewing the package manager all together and manually installing whatever versions you need.
Download your desired jre/jdk from the Oracle archives (You will need a free Oracle account) here for whatever architecture you need: https://www.oracle.com/java/technologies/downloads/archive/
I selected "Java SE 8 (8u211 and later)" from the menu and snagged jre-8u271-linux-x64.tar.gz.
From there, extract the archive to a location accessible to the user who will be running java; Typically I'll extract to "/usr/local/lib/jre1.8.0_271/".
From here you can run /usr/local/lib/jre1.8.0_271/bin/java successfully, as well as javaws.
/usr/local/lib/jre1.8.0_271/bin# ./java -version
java version "1.8.0_271"
Java(TM) SE Runtime Environment (build 1.8.0_271-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.271-b09, mixed mode)
On most of my systems I already have some packaged version of jre installed that's native to the release, so my /usr/bin/java and /usr/bin/javaws typically are symlinks to /etc/alternatives/java /etc/alternatives/javaws, respectively.
To switch the system to a particular jre, just update the relevant symlinks to point to the version of your choice:
rm /usr/bin/java /usr/bin/javaws /usr/bin/jjs /usr/bin/jcontrol
for i in java javaws jjs jcontrol; do ln -s /usr/local/lib/jre1.8.0_271/bin/$i /usr/bin/$i; done
Note that if you need, per say, jre 7, 11 and 17 you can download and extract each version to a particular named folder in /usr/local/lib, or your home directory if you'll be launching it manually, and utilize each of them individually as needed by updating the symlinks or just running them directly.
I just faced a similar problem:
I have on old HP-mini 210 netbook to be used as a "car logger" and it has to use java 8 32bit (required by the logger application).
I'm running a light distro based on Debian 10 (BunsenLabs Lithyum).
After poking around the easyest way I found to install java 8 32bits was by using an openjdk 8 deb package published by OpenLogic (they have 32 or 64 bits):
https://www.openlogic.com/openjdk-downloads
Just download and install (package manager). Worked 100% and now I have a super fast hp-mini "car logger".
I was migrating from Jessie to Buster, and found that not-so-old, legacy code would not compile and run on JDK11.
I managed to copy all java8 folders from my Jessie distribution, reworked the links, and set that as a new JDK on Eclipse. That works so far.
the easiest way I have found to download java 8 on debian buster is to use the command su apt-get install openjdk-8-jdk

Tesseract redhat tomcat 8 config - TessApi classdefnotfound

Tesseract run successfully in eclipse, windows 7, Tomcat 8
When I run the same application on linux machine(RHEL)+java 8+tomcat 8 I get classdefnotfound error. The class is present (TessAPI.class) in classes folder.
I did this to setup in linux.
tar xzf tomcat8.0.37.tar.gz
sudo yum install libpng-devel libjpeg-devel
sudo yum install libtiff
sudo yum install automake
sudo yum install libtool
yum install apr-devel openssl-devel
rpm -ivh jdk-8u101-linux-x64.rpm
tar xzf leptonica-1.69.tar.gz <- download this
cd /tmp/leptonica-1.69
./configure
make
sudo make install
tar xzf tesseract-ocr-3.02.02.tar.gz <- download this
cd tesseract-ocr
./autogen.sh
./configure
make
sudo make install
yum groupinstall "Development Tools"
source /etc/profile
sudo ldconfig
export LD_LIBRARY_PATH=/usr/local/lib
Am I missing something here?
After spending much time I successfully completed OCR integration with Red Hat linux, with all the steps above and below is additional step I have done, might be helpful for someone in near future :)
Added(created new file with name "setenv.sh" in tomcat_home/bin)
Add these lines
JRE_HOME=/usr/java/jdk1.8.0_101/jre
<-- this line as my default jre was 1.7
LD_LIBRARY_PATH=/usr/local/lib/:/usr/local/apr/lib:$CATALINA_HOME/lib
<-- /usr/local/lib location tesseract .so available
export LD_LIBRARY_PATH

Is it possible to install the JDK on an android device?

I want to be able to compile and run basic java apps within the android terminal termux. I checked out Terminal IDE, but that is incompatible with Android 5.0+. Additionally, I tried to install the arm64 jdk from Oracle's website, which android fails to recognize. I am running CM 13 and to clarify, I want to be able to run commands like javac and java directly from my phone.
If you have Termux, you can download the deb file here, and install it with apt-get install /path/to/deb. A command to download and install the JRE and JDK for arm:
cd ~ # Change to home directory
apt-get install -y wget # BusyBox wget doesn't support HTTPS
hash -d wget # Forgets the BusyBox wget path so new one is used
wget https://archive.org/download/openjdk-9-jre-headless_9.2017.8.20-1_x86_64/openjdk-9-jre-headless_9.2017.8.20-1_arm.deb # Download JRE
wget https://archive.org/download/openjdk-9-jre-headless_9.2017.8.20-1_x86_64/openjdk-9-jdk-headless_9.2017.8.20-1_arm.deb # Download JDK
apt-get install -y ./openjdk-9-jre-headless_9.2017.8.20-1_arm.deb ./openjdk-9-jdk-headless_9.2017.8.20-1_arm.deb # Install the files
rm openjdk-9-*.deb # Remove the files after because they're huge
Or a one-liner to copy and paste:
cd ~ && apt-get install -y wget && hash -d wget && wget https://archive.org/download/openjdk-9-jre-headless_9.2017.8.20-1_x86_64/openjdk-9-jre-headless_9.2017.8.20-1_arm.deb && wget https://archive.org/download/openjdk-9-jre-headless_9.2017.8.20-1_x86_64/openjdk-9-jdk-headless_9.2017.8.20-1_arm.deb && apt-get install -y ./openjdk-9-jre-headless_9.2017.8.20-1_arm.deb ./openjdk-9-jdk-headless_9.2017.8.20-1_arm.deb && rm openjdk-9-*.deb
To install for another architecture, replace occurences of "arm" with the correct architecture. There are files for "arm" (most 32-bit phones), "aarch64" (ARM64/armv8, most 64-bit phones), "i686" (x86), and "x86_64". Most phones have either arm or aarch64. I believe the arm version should at least work on aarch64 (may be wrong?), so arm should work for almost everyone. But if you know what your device has, use that instead.
Edit: to find your device's architecture, run uname -m from Termux.
#moderatelygood Go to Google Play Store and download GNURoot Debian. It is a fakeroot, i.e. terminal emulator. Many other terminal emulators are available in the Play Sore, but this ine is very good. It lives at https://github.com/corbinlc/GNURootDebian and website is http://corbinlc.github.io/GNURootDebian You can download many packages like this:
apt-get update
apt-get install default-jdk
apt-get install python
and so on.
You would be able to compile/run programs in these languages. Use some text editor to write programs, like Jota Text Editor, also available in Play Store.
Actually Terminal can be used if you're only interested in javac , java, jar . That is , you can use these three on Lollipop. I am using Terminal IDE on Android 5.1.1, it works as expected. The usable version can be found at https://www.dropbox.com/s/h2d23ecbrt2akeu/terminalide-2.02-binary-mod-signed.apk?dl=0. If you want to give it a try then open this mod terminal and do : cp /system/lib/libjavacrypto.so ~/system/lib , copying this library should do the job(did for me) leaving java and dx commands working.
Java can installed on termux. INSTALLION of java on termux take very short period of time and install directly from termux-source, this program really work for me, i am dame sure it will also work for you also......
git clone https://github.com/EagleComrade/Termux-java.git
cd Termux-java
chmod +x install.sh
bash install.sh

How to use django-pipeline in a virtual-env?

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"

Categories