Damir
Damir

Reputation: 56249

Get path of execution - from where I start jar file

Can I in my Java app find current path where I start that jar file ?
Path of execution ( example: C:\test\test_one> java -jar test.jar to get C:\test\test_one ) ?

Upvotes: 0

Views: 2640

Answers (1)

KevinS
KevinS

Reputation: 7882

You can. Within your code you can call System.getProperty("user.dir") to return the working directory of the application.

Upvotes: 5

Related Questions