maxsap
maxsap

Reputation: 3001

java can't run command line application

I am developing an application that will run a command line application from a Java interface. This app used to work on my fedora but now under Ubuntu I get this message:

Error opening terminal: unknown.

I am starting the application using this command:

 Process clientProcess = Runtime.getRuntime().exec(clientcommand);

where clientcommand is a string that contains the command to be run. also please note that when I copy and paste the command directly to the console the program runs as supposed.What am I doing wrong? is there an issue with running a command this way?

Upvotes: 0

Views: 859

Answers (1)

continuousqa
continuousqa

Reputation: 508

I know why this is happening, but I may not have a solution for you. But lets see...

I had this same problem on OSX. I was running .sh scripts form Jenkins. I would get this error. It turns out the issue is it doesn't know where or which terminal you want to use. Since Jenkins was sudo'ing as me, i went to my .bashrc and defined export TERM=xterm . That did the trick.

So now i have a situation where I'm developing a grails app and the same problem is occurring... but i dont know how to set the xterm for grails... as it isn't running as me.

But anyway, the issue is your system doesn't know which terminal to use... or how to reach it. By specifying your terminal it should work.

Upvotes: 1

Related Questions