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

Revision history [back]

I'm not sure if it is possible to use $() or `` inside roslaunch since it is actually bash syntax and I guess roslaunch just uses python. Instead, I suggest a different solution, something like a wrapper script to run something with JAVA_HOME set correctly. The script could look like this:

#!/bin/bash
export JAVA_HOME=$(rosrun rosjava find-java-home.sh)
exec ${@:1}

Then use it as launch-prefix for your node. If you have it working and want it to be added to the rosjava package, please drop me an email.

I'm not sure if it is possible to use $() or `` inside roslaunch since it is actually bash syntax and I guess roslaunch just uses python. Instead, I suggest a different solution, something like a wrapper script to run something with JAVA_HOME set correctly. The script could look like this:

#!/bin/bash
export JAVA_HOME=$(rosrun rosjava find-java-home.sh)
exec ${@:1}
$@

Then use it as launch-prefix for your node. If you have it working and want it to be added to the rosjava package, please drop me an email.