public class Test {
    public static void main (String[] args) {
        String oneWay;
        String oneOtherWay;
        String resultFilePath;
        try {
            oneWay = new java.io.File( "." ).getCanonicalPath();
            oneOtherWay = System.getProperty("user.dir");

//As the console is not supported under macos with jpackage applications the result is saved in the file /Users/.../tmp/resultFile.txt
            resultFilePath = System.getProperty("user.home") + "/tmp/resultFile.txt";
            BufferedWriter writer = new BufferedWriter(new FileWriter(resultFilePath));
            writer.write(" oneWay : \"" + oneWay + "\"\n oneOtherWay : \"" + oneOtherWay + "\"\n");

            writer.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
} 