File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dll in a Jar File

 
Bora Sayiner
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"?
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47229
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question too difficult for "beginning". Moving.
 
Bora Sayiner
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok i said any example about include dll to jar file. How can i do this. Thanks for your reply
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic