I need to start a .jar file with a specific java version, but if I path to the java version with:
cd "C:\Program Files\Java\jdk-15.0.2\bin"
java -jar C:\Users\Admin\Desktop\file\jarfile.jar
then the .jar file starts with java, but doesn't execute in its own directory, and instead executes in the java directory. I need it to execute in its own directory because it creates and needs the files in its own directory. How can I write this so that it starts with the java.exe that's in Program Files, but creates and reads files in the "file" folder, using batch?
"C:\Program Files\Java\jdk-15.0.2\bin\java" -jar
?