• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dll in a Jar File

 
Bora Sayiner
Greenhorn
Posts: 2
  • 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
Posts: 15441
41
Android IntelliJ IDE Java Scala Spring
  • 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
Posts: 42968
73
  • 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: 49796
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question too difficult for "beginning". Moving.
 
Bora Sayiner
Greenhorn
Posts: 2
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic