t***y 发帖数: 22 | 1 Must java program be executed at a specific directory even after setting the
class path? | g*****g 发帖数: 34805 | 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?
| m******t 发帖数: 2416 | 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.
| d***o 发帖数: 51 | 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
| m******t 发帖数: 2416 | 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
|
|