Fixed checks for java and jar
Give more max memory to stop openjdk from complaining