How i can get Drive name that java class running on that drive?
I need only drive name not whole path.
For example my file running in D:folder1Main.java and i need this: D:
D:folder1Main.java
D:
Use Path.getRoot(), which on Windows is the drive.
Path.getRoot()
2.1m questions
2.1m answers
60 comments
57.0k users