I'm running a little terminal jar tool by batch with:
%cd%
"c:\program files (x86)\Java\jre7\bin\java" -jar myfile.jar
But for every new machine I'm running this, I have to first check and edit the path to java home. Is there any batch way to not have to edit this all the time, but automating the java-homedir finding?