Developing Axoloti on Ubuntu 16.04, some install script updates


#1

Hi everyone! Especially Axoloti developers who have install Ubuntu 16.04.

This is just a note if you are running on Ubuntu 16.04. I'm using Ubuntu Studio 16.04 in this case.
There are a few small changes you'll need to do:

  1. Ubuntu 16.04 doesn't support openjdk-7-jdk like prev. versions. It supports 8 and 9 IIUC. You will see a message like this:

    Package openjdk-7-jdk is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or ...

When you get this, you need to add a repo by following the instructions here:


It's really simple, only three commands:
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-7-jdk

  1. Next you will have to set your JAVA_HOME variable to point to jdk 7. You will get an error message like this:

    BUILD FAILED
    /home/enzo/axoloti/nbproject/build-impl.xml:911: The following error occurred while executing this line:
    /home/enzo/axoloti/nbproject/build-impl.xml:261: Unable to find a javac compiler;
    com.sun.tools.javac.Main is not on the classpath.
    Perhaps JAVA_HOME does not point to the JDK.
    It is currently set to "/usr/lib/jvm/java-8-openjdk-amd64/jre"

To fix this, follow the directions here: https://www.unixmen.com/installing-java-jrejdk-ubuntu-16-04/

There may be more elegant ways to do this. (Does anyone know how to make it so only Axoloti uses jdk 7?) But for now, I handled it by adding this line to the end of my ~/.bashrc file:
export JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64/jre"
Then don't forget to run this to make it effective for your current shell:
source ~/.bashrc

Happy patching and developing!!!!!


#2

Is there a reason not to use openjdk8?
The build system (setup, logs) currently uses the oraclejdk8 package, not sure if anything prevents using openjdk8 instead?


#3

I was wondering the same thing... In fact, I don't even know how/why the system comes to try to use openjdk7. When the system says "but is referred to by another package," I imagined it was a constraint, so I left it...

... and since i was just in a rush, I went and figured out how to add openjdk7 to the install, but if you can share how/why the system tries to use rev. 7, or make any other suggestions, I would be happy to build it using rev. 8.


#4

Ok, just an update on this. I did a fresh clone (from a fork from axoloti master on github) and this time when I ran into the
"Unable to find javac" error I moved on to jdk8, so I realized I also needed to do:

sudo apt install openjdk-8-jdk (like you mentioned, Johannes) and it built just fine. This is from Ubuntu Studio 16.04, so I don't know what version of openjdk other Ubuntu/Linux installs come with...

Anyway, inside build.sh, it currently checks for jdk7. So maybe I should run this for a little bit and verify operation under jdk8? Or has that already been done?

Anyway, thanks again for this excellent platform. It's a pleasure developing sensors on it.