由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - is there anyway that i can return...
相关主题
Spring Library Bug?Java on AIX
[合集] Is there any free java PDF viewer?java rugular expression question
如何分析 recursive function 的复杂性java这个是什么逻辑?
made a low-level mistakeJAVA coding style
JSP程序中如何在客户端启动另外的JAR程序java beginner question
着急请教JAVA Question,谢谢JAVA 考试题请教
JAVA APPLICATION PATH 一问interesting
两个很基本的JAVA问题Re: java里怎么判断一个文件存在不存在?
相关话题的讨论汇总
话题: return话题: prog话题: value话题: java话题: anyway
进入Java版参与讨论
1 (共1页)
r*******w
发帖数: 121
1
a value from a main() function of a class?
and
how can i get the return value of a function call in a shell script
such as
return_value="java my_prog";
if(return_value==0) do_something;
is it possible to achieve in java?
thanks~
e***g
发帖数: 158
2
System.exit(0);

【在 r*******w 的大作中提到】
: a value from a main() function of a class?
: and
: how can i get the return value of a function call in a shell script
: such as
: return_value="java my_prog";
: if(return_value==0) do_something;
: is it possible to achieve in java?
: thanks~

r*******w
发帖数: 121
3
thanks~~~
is it possible to let "java my_prog" to return the value i returned in the
main function of class my_prog?
it seems to me (by a few small test programs) that "java my_prog" returns the
status code of the program "java"...not "my_prog"...
any workaround for this?
i need the return code of "my_prog" to run a batch job
thanks~

【在 e***g 的大作中提到】
: System.exit(0);
e***g
发帖数: 158
4
call System.exit(n) to terminate the program; n is returned to shell

【在 r*******w 的大作中提到】
: thanks~~~
: is it possible to let "java my_prog" to return the value i returned in the
: main function of class my_prog?
: it seems to me (by a few small test programs) that "java my_prog" returns the
: status code of the program "java"...not "my_prog"...
: any workaround for this?
: i need the return code of "my_prog" to run a batch job
: thanks~

r*******w
发帖数: 121
5
maybe i am making a stupid mistake...but
here is what i do
class my_prog {
static public void main(String[] args) {
System.exit(-1);
}
}
another perl file:
$return_value=system("java my_prog");
print $return_value;
the print out is random values...each time different...
maybe i did something wrong in the perl file?

the

【在 e***g 的大作中提到】
: call System.exit(n) to terminate the program; n is returned to shell
1 (共1页)
进入Java版参与讨论
相关主题
Re: java里怎么判断一个文件存在不存在?JSP程序中如何在客户端启动另外的JAR程序
java on 64-bit system着急请教JAVA Question,谢谢
Re: strange exceptionJAVA APPLICATION PATH 一问
Re: 有没有办法在browser第一次访问的时候知道是不是支持cookie?两个很基本的JAVA问题
Spring Library Bug?Java on AIX
[合集] Is there any free java PDF viewer?java rugular expression question
如何分析 recursive function 的复杂性java这个是什么逻辑?
made a low-level mistakeJAVA coding style
相关话题的讨论汇总
话题: return话题: prog话题: value话题: java话题: anyway