aspose file tools
The moose likes Java in General and the fly likes dll in a Jar File Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "dll in a Jar File" Watch "dll in a Jar File" New topic
Author

dll in a Jar File

Bora Sayiner
Greenhorn

Joined: Aug 21, 2011
Posts: 2
Hello. I' m using JNI for comminicate some native c++ methods. And I wanna make a distribution include this dll file to jar. How can i do this. Is there ant exam?
Thank for your answers.
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12950
    
    3

Welcome to the Ranch.

I don't think it is possible to include the DLL file inside the JAR file, if that is what you mean. Windows doesn't understand JAR files by itself, so it doesn't know how to find the DLL inside the JAR file. You'll need to distribute the DLL along with your JAR file, as a separate file. If you want to make it easy for your users, you could make an installer for your program which sets it up as it should. See Open Source Installer Generators for programs that can make an installer for your program.

What do you mean with "is there ant exam"?


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35431
    
    9
I don't think it is possible to include the DLL file inside the JAR file, if that is what you mean. Windows doesn't understand JAR files by itself, so it doesn't know how to find the DLL inside the JAR file. You'll need to distribute the DLL along with your JAR file, as a separate file.

I gotta disagree here. It's perfectly possible to distribute JNI libs via jar files. For example, signed jar files are the way to distribute JNI libs for use with JNLP and applets.


Android appsImageJ pluginsJava web charts
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32827
    
    4
Question too difficult for "beginning". Moving.
Bora Sayiner
Greenhorn

Joined: Aug 21, 2011
Posts: 2
ok i said any example about include dll to jar file. How can i do this. Thanks for your reply
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: dll in a Jar File
 
Similar Threads
Signing native code?
what is dll?
Dll Loading
run dll from with a jar file
connecting to sap R/3 ?