ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Adding an external jar in Rosjava

asked 2016-08-04 12:05:21 -0500

Pickman gravatar image

updated 2016-08-05 19:40:32 -0500

I need to add an external jar in Rosjava. I noticed several references to a file manifest.xml in other questions that my package (catkin generated) does not have. I noticed that there's a package.xml file that allows me to add dependencies but I don't need to only add the dependency, I need to add the jar to make the project compile (using gradle, I didn't look into other compiling methods so far). Adding it to /usr/lib/java (the location I normally use for java projects does not seem to work at all. I've wasted a few days for this rather trivial matter and I'm quite perplexed about what I'm supposed to do. Thanks for your help.

P.s.: I managed to add the external libraries so far by editing the build.gradle file and adding the opportune dependencies as stated in gradle's documentation. Initially I faced difficulties because nothing pointed me at the documentation in the first place so I struggled to find it (and I have to say that it's rather well written). So I'm adding the link below. I'm still facing some problems with rosjava_geometry msgs but I'm confident this difficulty can be solved in a short time and will edit the question and possibly add an answer as soon as I'm able to work a bit on my project. At the moment the situation is that I lack appropriate documentation of the rosjava messages, examples of how to use them in my project and a precise idea of how the package.xml file role in all that (it seems slightly different than the package's manifest of ROS).

edit retag flag offensive close merge delete


Okay, I made some progress and was able to add external libraries through the build.gradle file which details the dependencies that gradle is going to link (if you like me use gradle to compile the package, I'm editing the question to specify that I'm using gradle).

Pickman gravatar image Pickman  ( 2016-08-05 19:28:43 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-08-10 10:42:06 -0500

Pickman gravatar image

Turns out that the package.xml file is not influencing my build at all apparently (maybe it's caused by my use of gradle to compile) and the one I had to edit was the build.gradle file by adding an appropriate reference directly to the jar. The following links to gradle's documentation. It explains clearly how to create a dependency.

edit flag offensive delete link more

Question Tools


Asked: 2016-08-04 12:05:21 -0500

Seen: 320 times

Last updated: Aug 10 '16