Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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
Missing name Mising name is currently offline Missing name Mising name
Messages: 24
Registered: November 2010
Junior Member
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]

Report message to a 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
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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: Fri Jul 25 11:59:09 EDT 2014

Powered by FUDForum. Page generated in 0.01621 seconds