NIO-package and IBM J9

T

Tobias Ginzler

Hello all,

i tried to get the java.nio.* package working under the IBM J9 VM. As I am
dependent on the CDC-Version of J9, it does not come with the nio-package by
default. I thought this should be no problem to enable it by including a
nio.jar in the classpath and importing it. All went fine. I told Eclipse to
include the jar (I got it from the Apache harmony project), attached the
source and the integration was working in Eclipse. Compilation of my test
class using nio was successful.

Then executing my example class throws a exception:
"java.lang.SecurityException: java.nio.charset.Charset - protected system
package 'java.nio.charset'"

Ok, no problem - I moved the import of the nio-files to the system library
section (Installed JREs->Edit in Eclipse).

But then J9 appearently does not load the nio-classes any more:

Exception in thread "main" java.lang.NoClassDefFoundError:
java.nio.charset.Charset
at net.cimte.Cimte.<clinit>(Cimte.java:30)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)

Mh. Maybe something with eclipse is wrong. So I copied the nio.* class files
directly in the bootclass file of J9 (classes.zip). But I got the same
result. I think it should work, or am I completely wrong?


Greetings,
Tobias
 
E

EJP

Tobias said:
i tried to get the java.nio.* package working under the IBM J9 VM. As I am
dependent on the CDC-Version of J9, it does not come with the
nio-package by
default. I thought this should be no problem to enable it by including a
nio.jar in the classpath

That's not sufficient, and probably on the JVM concerned nothing will be
sufficient. NIO relies on lots of other things including native JNI code
and platform support. If it isn't available with the JVM there's a good
reason.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,141
Latest member
BlissKeto
Top