Answers for "getPath java"

3

java get relative path

String path = "/var/data/stuff/xyz.dat";
String base = "/var/data";
String relative = new File(base).toURI().relativize(new File(path).toURI()).getPath();
// relative == "stuff/xyz.dat"
Posted by: Guest on September-13-2021
-1

java get classpath

java -classpath D:\Project\bin;D:\Project\src\  Main

Output 
Getting : D:\Project\bin;D:\Project\src\
Want    : D:\Project\bin
Posted by: Guest on June-03-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language