This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Retun value of Runtime.exec in linux 32 bit

 
Anil kumar P
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
From my standalone java application an exe is invoked, which retuns
value till 255.
But in linux 32 bit environment, if the return value
is above 128, then it is returning -1, not the actual value.

Process process = Runtime.exec(".sh file invoking the exe");
int return = process.waitFor();
return variable is having -1, if value is greater than 128.

If the above exe is executed from telnet client, it is returning correct
value 255.

This issue doesnt exist in any Unix 64 bit env.
Java version installed in 1.4.2.5_16

Pls advice

thanks
Anil
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Anil kumar P",
Please check your private messages.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure the problem is in your Java program? Try writing a short shell script that captures the return value and prints it (so there's no Java involved at all). Can you get values greater than 128?
 
Anil kumar P
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The shell script is returning value as 255 only.
But the java programme is returning as -1.

If the return value is less than 128, then java is also returning
correctly as 128.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Anil kumar P",

It is important that you follow the directions in your private messages.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic