Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Retun value of Runtime.exec in linux 32 bit

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Anil kumar P",
Please check your private messages.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Anil kumar P",

It is important that you follow the directions in your private messages.
 
What are you doing? You are supposed to be reading this tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic