Compilation Crash NoClassDefFoundError for sbt

Upgrading to Gatling 3 happened at the same time as a required move to artifactory so I’m not sure which if one or both are responsible but I’m getting the following error running my simulation on Ubuntu. Mac OS seems fine as well as Intellij. I’ve tried adding sbt to the pom and a few different strategies for resolving dependencies, no luck.

java.lang.NoClassDefFoundError: Could not initialize class sbt.internal.io.Milli$
	at sbt.io.IO$.getModifiedTimeOrZero(IO.scala:1214)
	at sbt.internal.inc.caching.ClasspathCache$.fromCacheOrHash$1(ClasspathCache.scala:33)
	at sbt.internal.inc.caching.ClasspathCache$.$anonfun$hashClasspath$1(ClasspathCache.scala:42)
	at scala.collection.parallel.mutable.ParArray$Map.leaf(ParArray.scala:656)

Any suggestions on how to fix?

TIA, ML

Corrupted downloaded sbt artifact? Try removing ~/.sbt.

I don’t see a ~/.sbt directory. I tried deleting everything from my .m2/repositories directory as well as mvn clean. Still same error

Pure shot in the dark: this class seems to be using JNA, which by default extracts a native lib in /tmp and loads it.
Is /tmp mounted with noexec?

That was definitely it, excellent nighttime shooting :wink:

Remounting with exec fixes the problem, though I’d prefer to change the java temp directory but haven’t had much success:

JAVA_OPTS="-Djava.io.tmpdir=/opt/tmp" MAVEN_OPTS="-Djava.io.tmpdir=/opt/tmp" mvn gatling:test

Still uses /tmp/

The following worked for me when using gatling-charts-highcharts-bundle-3.0.3/bin/gatling.sh :

export JAVA_OPTS="$JAVA_OPTS -Djna.tmpdir=/opt/tmp"