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 / May 2005

Tip: Looking for answers? Try searching our database.

dll in jar?

Thread view: 
DeMarcus - 16 May 2005 23:14 GMT
Why can't I put my dll in a jar and load it
just like I load my icons?

Daniel
Boudewijn Dijkstra - 16 May 2005 23:43 GMT
> Why can't I put my dll in a jar and load it
> just like I load my icons?

Because dll's are libraries and icons are regular resources.
Steve Sobol - 16 May 2005 23:47 GMT
>>Why can't I put my dll in a jar and load it
>>just like I load my icons?
>
> Because dll's are libraries and icons are regular resources.

And what good would a DLL do if you aren't running your Java app on Windows...?

Signature

JustThe.net - Apple Valley, CA - http://JustThe.net/ - 888.480.4NET (4638)
Steven J. Sobol, Geek In Charge / sjsobol@JustThe.net / PGP: 0xE3AE35ED

"The wisdom of a fool won't set you free"
    --New Order, "Bizarre Love Triangle"

DeMarcus - 17 May 2005 07:46 GMT
>>> Why can't I put my dll in a jar and load it
>>> just like I load my icons?
[quoted text clipped - 3 lines]
> And what good would a DLL do if you aren't running your Java app on
> Windows...?

You've got a point there.
castillo.bryan@gmail.com - 17 May 2005 06:30 GMT
I'm guessing that most JVMs uses the function LoadLibraryEx for windows
and dlopen for unix.  Both of these C functions take a string which
gets mapped to a file (in most cases).  Niether of these C functions
know how to load libraries out of jar or zip files.

In order for a java application to load these from a jar, they would
probably have to extract the dll's or SO's from the jar to the
filesystem.  You could do this manually in your static initializer if
you really wanted to.

I believe that there is an option to specify native libraries, for use
in webstart applications, downloaded from a webserver.  You might take
a look at how webstart does it, or just use webstart for deployment.

Basically, loading executable native code into a process space is
beyond the scope and control of the JVM and the JVM has to fit within
the confines of the OS.

I'm guessing that you are running into some deployment issues.  You
might want to describe the environment and the problems you are having.
However, you might just be curious.......
DeMarcus - 17 May 2005 07:49 GMT
> I'm guessing that most JVMs uses the function LoadLibraryEx for windows
> and dlopen for unix.  Both of these C functions take a string which
[quoted text clipped - 17 lines]
> might want to describe the environment and the problems you are having.
>  However, you might just be curious.......

I was just curious why System.loadLibrary() can't take a URL instead
of a String, but the fact that it violates portability having a dll in
a jar may be a good explanation to me.
Tor Iver Wilhelmsen - 17 May 2005 07:21 GMT
> Why can't I put my dll in a jar and load it
> just like I load my icons?

Because Windows doesn't look for DLLs in jars.


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.