I have *.so library and want to pack project into jar. Can someone help with problem how to force maven to pack native libraries so when i run jar they can be used?
i don`t want to add .so as new artifact. It is build also with maven before i build main java project so i just want to pack them into jar so i can use it.
Thanks.
I've copied resources before but couldn't read .so which was within the jar. So finally I've found Load library from jar and achieved my goal.
Related
For a project I completed a game in Java on Eclipse using LibGDX. I now need to turn in the source code to my professor. When I export the project and try opening it on a new computer, about a dozen libraries are missing.
I would like to export my entire project so that when the project is opened in eclipse, it will still compile. Is there any way to do this? I know that runnable jars come with the .jar files of the dependencies and no source code, but I need both.
Thanks in advance
Libgdx required number of dependent jars so it's hard to manually add all jars into project.
Make your project gradle based so that When you import your project through gradle into another System then gradle do most of your task* for you.
*gradle try to find dependent jars in file system if already exist then link with your project if not then it download from given repository and link them in your project. Make sure your system is connected with internet when you build your project.
I highly encourage to use Android Studio or IntelliJIDEA.
On window, by default all jars are stored inside
C:\Users\User_name\.gradle\caches\modules-2\files-2.1
In Mac OSX
/Users/User_name/.gradle/caches/modules-2/files-2.1
When you want to deploy or packaging for the desktop run this command on your IDE terminal.
gradlew desktop:dist
You can use maven or gradle to build your project, take a look of one of the tool and it's won't take you too much time. these tool could help you define your own way for build
A much easier way you could use "fat jar". this is an old tool for build a jar with all lib you need and could be run in any place.
Could anyone would be so kind and explain how to make a single jar file with all maven dependencies in Netbeans Maven Java Application? In Eclipse user can Export to Runnable jar file and select Package required libraries into generated JAR, so all dependencies within project comes in created jar file. In Netbeans there is no such option.
I have checked other answers, but the only thing i understand is that I have to add code to Build.xml file which is not even in the project.
The last time I had to do this I used the Maven Shade Plugin. It allows you to create a single JAR file and also handles dependency clashes.
A simpler solution (which doesn't handle dependency clashes) is to use the Maven Assembly Plugin.
Note that these are pure Maven solutions which should work in any IDE.
I have a plugin that depends on external jar files.
I've made an update site to install the plugin into any eclipse.
These external jar files are shipped with the plugin.
I want to separate these external dependencies so that the plugin needs them during the installation and get them at the installation time. or search for them in a specific location away from the plugin jar file
Is that possible?
If so, How can I achieve that ?
Create separate plug-in's for each of the external jar's?
Like the way Eclipse handles things like Apache components.
I have a little problem importing a project to my android project.
I have built a little library using Ical4Java to parse a .ical file, and that library is exported to a .jar.
In my Android Project i have imported and added to the build path my generated .jar from my library that includes some jars to make my library work.
But when i run my application it just crashes and i get this on the LogCat:
E/AndroidRuntime(14382): java.lang.NoClassDefFoundError: net.fortuna.ical4j.data.CalendarBuilder
That library (ical4j.jar) is imported on the library buildpath and is exported whith my library (mylibrary.jar)..
You can use One-Jar to help you use a jar file that is dependent on other jar files. Basically you can combine them into one jar file.
Here is a little tutorial to help you.
Just put the content of the one jar into the other jar (combine them). They are just zip files.
Is mylibrary.jar an executable jar file?
If so, you cannot reference external jars.
I've tried to build my project with NetBeans 6.5; The thing is the project contains external jars added so I need them all being placed into my jar file (because it is to be signed); but IDE just places project classes in the jar :(
So my question is how to place project dependent external libs into my project JAR with NetBeans ?
I think you need something like this fat jar tutorial. I'm not sure if it's easier than building with an Ant script, but it should do the trick.