When running an app created by jpackage, the current working directory is set to the "app" directory.
confirmed building simple app-image from app with the following source:
import java.io.*;
public class pwd {
public static void main (String[] args) {
try {
String current = new java.io.File( "." ).getCanonicalPath();
System.out.println("Current dir:"+current);
} catch (Exception e) {
e.printStackTrace();
}
}
}
It would be expected that an app run from a command line should have the current working directory of the shell that invoked it.
confirmed building simple app-image from app with the following source:
import java.io.*;
public class pwd {
public static void main (String[] args) {
try {
String current = new java.io.File( "." ).getCanonicalPath();
System.out.println("Current dir:"+current);
} catch (Exception e) {
e.printStackTrace();
}
}
}
It would be expected that an app run from a command line should have the current working directory of the shell that invoked it.
- relates to
-
JDK-8227058 Regressions related to no longer setting user.dir
-
- Resolved
-
-
JDK-8228402 chdir() and write() errors are not handled in jpackage
-
- Resolved
-
-
JDK-8257979 [macos]:jpackage's working directory is different from javapackager
-
- Closed
-
-
JDK-8306974 [macos] Current working directory wrong when running jpackage app
-
- Closed
-
-
JDK-8308349 missing working directory option for launcher when invoked from shortcuts
-
- In Progress
-