jvm class path unicode native methods

T

timprepscius

Okay.. I'm having the following problem.. I've tried pretty much every
solution I can think of but always hit some brick wall.

I need to:
load classes from a jar in a unicode directory and register native
methods for those classes.

Before (the unicode) I was simply doing a -Djava.class.path=myjar.jar
And then registering the native methods..

But.. I can't find a way to send a unicode code string to through the
-Djava.class.path..

So I've tried:

1. sending the string as utf8.. nope.
2. setting environment variable classpath with
SetEnvironmentVariableW.. nope.
3. creating my own url class loader with the jar..
Loads fine.. BUT NATIVE METHODS DO NOT REGISTER CORRECTLY (even
though the jnienv says they do.. they don't.. apparently I can only
register native methods from classes loaded from the jnienv_ sucky..)

4. creating my own url class loader that loads the byte code directly
from the jar, then calls defineClass from the root class loader.
NOPE.. because classes reference each other.. therefore the entire
jar must be available when ever I reference one class.

5. found out the class Launcher and its methods getClassLoader,
appendblahblahfor instrumentation..
NOPE.. although.. I've sort of giving up now.. this is going too far.

--

Any help?
Surely there are some japanese programmers that have dealt with this
before.

-tim
 
T

timprepscius

Okay.. I'm having the following problem.. I've tried pretty much every
solution I can think of but always hit some brick wall.

I need to:
load classes from a jar in a unicode directory and register native
methods for those classes.

Before (the unicode) I was simply doing a -Djava.class.path=myjar.jar
And then registering the native methods..

But.. I can't find a way to send a unicode code string to through the
-Djava.class.path..

So I've tried:

1. sending the string as utf8.. nope.
2. setting environment variableclasspathwith
SetEnvironmentVariableW.. nope.
3. creating my own url class loader with the jar..
Loads fine.. BUT NATIVE METHODS DO NOT REGISTER CORRECTLY (even
though the jnienv says they do.. they don't.. apparently I can only
register native methods from classes loaded from the jnienv_ sucky..)

4. creating my own url class loader that loads the byte code directly
from the jar, then calls defineClass from the root class loader.
NOPE.. because classes reference each other.. therefore the entire
jar must be available when ever I reference one class.

5. found out the class Launcher and its methods getClassLoader,
appendblahblahfor instrumentation..
NOPE.. although.. I've sort of giving up now.. this is going too far.

--

Any help?
Surely there are some japanese programmers that have dealt with this
before.

-tim

I've gotten this to work my manipulating the system class loader.. but
it's so sucky.. any better ideas?

bump
 
T

timprepscius

I've gotten this to work my manipulating the system class loader.. but
it's so sucky.. any better ideas?

bump

So the way I've gotten it to work post 1.5.1 is to get the system
class loader
get the "Laucher" object with method "getLauncher" getting the
AppClassLoader with "getClassLoader" and calling addURL (because
appendblahblahforinstrumentation) doesn't exist before 1.6.? .

BUT.. This doesn't work with version < 1.5.0.004..

Any ideas on how to specify a jar for the jvm in a unicode class path?

Nobody has dealt with this?

-tim
 

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,770
Messages
2,569,586
Members
45,089
Latest member
Ketologenic

Latest Threads

Top