6

I try to work with the snappy module in python using conda as a virtuelenv. I have in Linux Mint 18 Sarah.

I have the module snappy, but if i try to test it with the following code: from snappy import ProductIO I got the following response:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/mara/.snap/snap-python/snappy/__init__.py", line 61, in <module>
    import jpyutil
ImportError: No module named 'jpyutil'

Thus, I tried to get jdk with pip install -i https://pypi.anaconda.org/pypi/simple jpy . And i got: Error: Environment variable "JDK_HOME" must be set to a JDK (>= v1.6) installation directory

Thus, I installed jdk1.8.0_111. I used this instruction: https://community.linuxmint.com/tutorial/view/1372. But I don't know how to set the JDK_HOME variable in a correct way. I tried it using an instruction for JAVA_HOME (https://askubuntu.com/questions/175514/how-to-set-java-home-for-java) and write JDK_HOME="/opt/java/jdk1.8.0_111" in the environment file but it doesn't work. I got the same Error like before changing the environment file.

Hope somebody can help me.

Ioannis Nasios
  • 8,292
  • 4
  • 33
  • 55
Marek
  • 160
  • 1
  • 2
  • 17
  • check this link, i think the same to ubuntu as well https://douglascayers.com/2015/05/30/how-to-set-custom-java-path-after-installing-jdk-8/ – murthy Dec 07 '16 at 13:17
  • this is a instruction for windows. and i read/posted an instruction for mint/ubuntu for JAVA_HOME. – Marek Dec 07 '16 at 13:19
  • may be this might works for you https://www.youtube.com/watch?v=qlT0T9NjKZ4 – murthy Dec 07 '16 at 13:22
  • No, it doesn't work. I set JAVA_HOME like the video told me. – Marek Dec 07 '16 at 16:28

1 Answers1

4

Create a symbolic link:

ln -s /opt/java/jdk1.8.0_111 /opt/java/latest

Directory listing for /opt/java:

.
jdk1.8.0_111/
latest/ -> /opt/java/jdk1.8.0_111

Set exports

export JDK_HOME=/opt/java/latest
export JAVA_HOME=${JDK_HOME}
export PATH=$PATH:${JAVA_HOME}/bin

Now, when you install a new version of the Java JDK, simply alter your latest symbolic link.

Mr. Polywhirl
  • 42,981
  • 12
  • 84
  • 132
  • 1
    Ok. It solves the problem, but I get a new error. `Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-p2voq_f8/jpy/setup.py", line 100, in with open('README.rst') as file: FileNotFoundError: [Errno 2] No such file or directory: 'README.rst' ` – Marek Dec 07 '16 at 16:34
  • Just Google: [***FileNotFoundError setup.py module README.rst***](https://www.google.com/search?q=FileNotFoundError+setup.py+module+README.rst). Your new issue is not related to your installation. Java is irrelevant at this point. – Mr. Polywhirl Dec 07 '16 at 17:41