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

Error in building new package in rosjava_core

asked 2012-10-28 06:37:20 -0600

safzam gravatar image

updated 2012-10-30 03:09:10 -0600

Hi,

I want to build a new rosjava_core package and follow the same step as given here. I used build.gradle as given in tutorial and on using both commands gradle build and gradle installApp I get error:

A problem occurred evaluating root project 'test_java_core'.
Cause: Could not find method maven() for arguments [build_qrpk3gb7vg4fn9nn26dq7oqkj$_run_closure1_closure3@11eea7f0] on root project 'test_java_core'.

Then I copied build.gradle from rosjava_tutorial_pubsub to my new package. I got error:

A problem occurred evaluating root project 'test_java_core'.
Cause: Project with path ':rosjava' could not be found in root project 'test_java_core'.

Did some one have same problem? Any hints about the solution? Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2012-10-30 03:07:14 -0600

updated 2012-10-30 03:13:43 -0600

The first problem is that the gradle version you're using (probably the one from the Ubuntu repos, installed via apt-get) is too old for rosjava. You can find out which version you're using by running

gradle -v
  • throws the error you mentioned (Oneiric version): Gradle 1.0-milestone-3
  • works (rosjava version): Gradle 1.0-milestone-9

You have two options. Either you manually install the newest gradle from the web site, or you use the gradle version bundled with rosjava like this:

mkdir ~/bin
ln -s ros/stacks/rosjava_core/gradlew ~/bin/gradle    # or wherever you installed rosjava_core
echo 'export PATH=~/bin:$PATH' >> .bashrc
source .bashrc

As for your second problem, don't copy the build.gradle file from rosjava_tutorial_pubsub, because it won't work outside the rosjava_core directory (it's meant to be built as a subproject of rosjava). Instead, use the build.gradle file from the rosjava "Getting Started" page you linked to.

edit flag offensive delete link more

Comments

Martin Günther gravatar image Martin Günther  ( 2012-10-30 03:26:09 -0600 )edit

Now it compiles. but gives error: my_workspace/test_java_core/src/main/java/org/ros/test_java_core/Listener.java:28: GraphName(java.lang.String) has private access in org.ros.namespace.GraphName return new GraphName("test_java_core/listener"); I took listener and talker from pubsub tutorial.

safzam gravatar image safzam  ( 2012-10-30 06:22:52 -0600 )edit

Again, that's a different problem, so please open a new question for that. And since my answer solved your problem, please mark it as correct. Thank you.

Martin Günther gravatar image Martin Günther  ( 2012-10-30 10:08:33 -0600 )edit

ok, thanks...it compiles and has successfully used the gradle bundled with rosjava. Can you please now answer the query on http://answers.ros.org/question/47142/graphname-private-access-error-in-rosjava_core/

safzam gravatar image safzam  ( 2012-10-30 23:26:00 -0600 )edit

Do you even read my comments?

> And since my answer solved your problem, please mark it as correct. Thank you.

These rules are there to indicate to other people looking for an answer, or willing to provide an answer, that this problem is solved (and what the solution was), so please abide to them.

Martin Günther gravatar image Martin Günther  ( 2012-10-30 23:40:39 -0600 )edit

hi hi yes I have marked it as correct by clicking on good sybmol under the answer number on left uper side . I did not know this before. thanks..its done now :-).

safzam gravatar image safzam  ( 2012-10-31 00:57:39 -0600 )edit

Question Tools

Stats

Asked: 2012-10-28 06:37:20 -0600

Seen: 1,384 times

Last updated: Oct 30 '12