Redian新闻
>
where to execute java program?
avatar
where to execute java program?# Java - 爪哇娇娃
t*y
1
Must java program be executed at a specific directory even after setting the
class path?
avatar
g*g
2
Write a batch or shell script for every java program you want to
execute, then you can deam it like a windows program
you can call it from anywhere, or by double click an icon.

【在 t***y 的大作中提到】
: Must java program be executed at a specific directory even after setting the
: class path?

avatar
m*t
3
In fact a lot of java programs assume they are started from a certain
directory, e.g., the application installation home. So either the script or
the shortcut would need to take care of that...

the

【在 g*****g 的大作中提到】
: Write a batch or shell script for every java program you want to
: execute, then you can deam it like a windows program
: you can call it from anywhere, or by double click an icon.

avatar
d*o
4
If no relative path is given in the classpath, the start dir is not a problem.
Otherwise, for example, if you want to start Tomcat or weblogic, you have to
get into the bin or appserver folder.
A recommendation: In many cases when you start a Java program in a DOS prompt,
you would have to keep the DOS prompt. If you kill the DOS, the Java
application will also be killed. With exe4j, you can wrap the Java program in
an exe file.
http://www.ej-technologies.com

【在 m******t 的大作中提到】
: In fact a lot of java programs assume they are started from a certain
: directory, e.g., the application installation home. So either the script or
: the shortcut would need to take care of that...
:
: the

avatar
m*t
5

classpath isn't the only problem. Some less careful program might just
open file using, say, new FileStream("foo.txt");

【在 d***o 的大作中提到】
: If no relative path is given in the classpath, the start dir is not a problem.
: Otherwise, for example, if you want to start Tomcat or weblogic, you have to
: get into the bin or appserver folder.
: A recommendation: In many cases when you start a Java program in a DOS prompt,
: you would have to keep the DOS prompt. If you kill the DOS, the Java
: application will also be killed. With exe4j, you can wrap the Java program in
: an exe file.
: http://www.ej-technologies.com

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。