Question

I am working on a Java test project using Cassandra for persistence and Achilles as my client API for Cassandra. Also, for testing purposes I am running Gradle builds on this project in Drone.io.

The Achilles library depends on Java 7, which is one of the possible types of builds for Drone.io, but since this is a Gradle build, it is necessary to make it a Groovy build. According to this official doc page, it should still be possible to use Java 7 inside the Groovy JVM with just an additional command in the build script in order to change from the default 1.6 JVM:

sudo update-java-alternatives -s java-1.7.0-openjdk-amd64

However, after adding that line to the build instructions, I get the following error messages from the Drone.io build log:

update-alternatives: error: no alternatives for mozilla-javaplugin.so.
update-java-alternatives: plugin alternative does not exist: /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/IcedTeaPlugin.so

This is apparently a frequent error for which I managed to Google a number of solutions. My problem is that all of these solutions involve installing plugins and/or adding entries to the sources list, which doesn't seem to be very straightforward in the Drone.io virtual machine.

One solution was running sudo update-alternatives --install /usr/lib/mozilla/plugins/mozilla-javaplugin.so mozilla-javaplugin.so /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libnpjp2.so 1 (I updated the path from the original solution in order to reflect the VM's directory structure) to install the missing lib, but there is no libnpjp2.so file at this location in the VM.

Has anyone had better luck using Java 7 in Groovy/Gradle builds in Drone.io or has any idea of a workaround?

Was it helpful?

Solution

The best way to use Gradle with drone.io (and even in general) is via the Gradle Wrapper. This works with any drone.io build type, so you can simply select Java 7.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top