# How to compile and run rosjava Hello World

Ok, rosjava_core is build.

Now I moved to the Hello World tutorial "http://docs.rosjava.googlecode.com/hg/rosjava_core/html/getting_started.html".

I used the gradlew wrapper and copy pasted the gradle folder into my package folder because otherwise it would not even slightly work. The build error said that certain classes/symbols could not be resolved from the Hello World Code.

But before I even start spewing out the error messages, I first want to ask a much simpler question: In the sense of the tutorial (http://docs.rosjava.googlecode.com/hg/rosjava_core/html/getting_started.html), am I supposed to create my test package inside the rosjava_core folder or am I allowed to set it up anywhere in /home?

edit retag close merge delete

Sort by » oldest newest most voted

Edit:

Nope, still problems :-). Forget what I wrote before.

I can build the example packages in the rosjava_core folder as described in (http://docs.rosjava.googlecode.com/hg/rosjava_core/html/getting_started.html).

What I did next was copy pasting the example package "rosjava_tutorial_pubsub" and renaming the package to "rosjava_testPackage" as a test. In the folder rosjava_testPackage I renamed everything accordingly. But now ../gradlew installApp yields the errors:


FAILURE: Build failed with an exception.

* Where:
line: 22

* What went wrong:
A problem occurred evaluating root project 'rosjava_testPackage'.
Project with path ':rosjava' could not be found in root project 'rosjava_testPackage'.

* Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 0.834 secs


I used the same gradlebuild file as in the example package "rosjava_tutorial_pubsub", which looks like this:


/* .... */

apply plugin: 'application'

mainClassName = 'org.ros.RosRun'

dependencies {
compile project(':rosjava')
}


Line 22 refers to "compile project(':rosjava')".

How can there be errors if the test package is a renamed copy of the tutorial package?

Edit 2: Problem solved. I had to manually register the package in gradle settings.

more

So long as your paths etc are set up you should be able to set up the package where ever you like

more