Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
This solution is better than others and more portable:
Path cwd = Path.of(“”"").toAbsolutePath();
Or even
String cwd = Path.of(“”"").toAbsolutePath().toString();
Path cwd = Path.of(“”).toAbsolutePath();
String cwd = Path.of(“”).toAbsolutePath().toString();
Path cwd = Path.of("").toAbsolutePath();
String cwd = Path.of("").toAbsolutePath().toString();
Path cwd = PathsPath.getof(""“”).toAbsolutePath();
String cwd = PathsPath.getof(""“”).toAbsolutePath().toString();
Path cwd = Paths.get("").toAbsolutePath();
String cwd = Paths.get("").toAbsolutePath().toString();
String cwd = Paths.get("").toString();