Skip to main content



      Home
Home » Newcomers » Newcomers » Can't run /usr/bin/ command in Eclipse java application?
Can't run /usr/bin/ command in Eclipse java application? [message #931952] Wed, 03 October 2012 13:30 Go to next message
Eclipse UserFriend
Hello, I am developing a Java application in Eclipse on Mac Pro, similar to Linux environment.

In my code I need to do something like:

Runtime rt = Runtime.getRuntime();
String cmd = "ttg " + inFileName + " -o" + outFileName;

"ttg" is installed under /usr/bin and can be executed in a terminal, but can't be executed here in Eclipse. I have to specify the full path:

String cmd = "/usr/bin/ttg " + inFileName + " -o" + outFileName;

Under Windows, we can set this through Environment Variables. why the application in Eclipse can't call "ttg" without specifying the full path?

Any way out? Thanks.

[Updated on: Wed, 03 October 2012 13:31] by Moderator

Re: Can't run /usr/bin/ command in Eclipse java application? [message #941487 is a reply to message #931952] Fri, 12 October 2012 11:20 Go to previous message
Eclipse UserFriend
Eclipse is probably not launched with the full path available to you at the shell. You'll have to investigate your mac environment to understand if mac does this or not.

PW
Previous Topic:Difference between "$()" and "${}" variable types in creating eclipse templates
Next Topic:JRE or JDK?
Goto Forum:
  


Current Time: Sun Jul 13 01:18:25 EDT 2025

Powered by FUDForum. Page generated in 2.35315 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top