Search code examples
javaconcurrencyexecutorservicej9

Ibm j9 java.util.Executors ClassNotFound


I am developing an application using IBM j9 JDK. When I try to use the following line of code:

ExecutorService es = Executors.newSingleThreadExecutor();

I get a runtime exception saying NoClassDefFoundError for java.util.Executors

Is there a different way I can open a concurrent thread using ibm j9?


Solution

  • Apparently you are running a pre-1.5 java version, so you'll need to adapt, perhaps with pre-1.5 util.concurrent library which has a QueuesExecutor.

    Without library you could use a Thread and implement a thread-safe queue yourself.