I need to add a user profile variable in java, apparently %userprofile% does not work. when I try and enter this into the directory towards the bottom of the code it does not accept it. however I can echo my %userprofil% in command line
userprofile+”\Downloads\file.txt”);
so
Then manipulate as desired (e.g. append the rest of your path…)
Alternatively, get the whole environment with
Map<String,String> System.getenv()