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()
1.4m articles
1.4m replys
5 comments
57.0k users