Skip to main content


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 17:30 Go to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 28
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 17: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 15:20 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
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: Tue Sep 24 19:17:43 GMT 2024

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

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

Back to the top