Setting freemarker template from classpath

this is what ended up working for me: freemarkerConfiguration = new Configuration(Configuration.VERSION_2_3_28); freemarkerConfiguration.setClassForTemplateLoading(this.getClass(), “https://stackoverflow.com/”); Template freemarkerTemplate = freemarkerConfiguration.getTemplate(“email/vendor.tpl”);