Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2008

Tip: Looking for answers? Try searching our database.

jvm class path unicode native methods

Thread view: 
timprepscius - 23 Apr 2008 21:27 GMT
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
timprepscius - 24 Apr 2008 17:30 GMT
> Okay.. I'm having the following problem.. I've tried pretty much every
> solution I can think of but always hit some brick wall.
[quoted text clipped - 35 lines]
>
> -tim

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

bump
timprepscius - 25 Apr 2008 14:53 GMT
> > Okay.. I'm having the following problem.. I've tried pretty much every
> > solution I can think of but always hit some brick wall.
[quoted text clipped - 40 lines]
>
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.