import java.io.*;
import java.util.*;
import freemarker.template.*;
public class HelloFreemarker {
public static void main(String[] args)
throws IOException, TemplateException {
Configuration cfg = new Configuration();
cfg.setObjectWrapper(new DefaultObjectWrapper());
cfg.setDirectoryForTemplateLoading(new File("."));
Map<String, Object> model = new HashMap<String, Object>();
model.put("name", "World");
Template template = cfg.getTemplate("hello.ftl");
template.process(model,
new OutputStreamWriter(System.out));
}
}
hello ${name}!
I have written a java program using freemarker template.But it's showing configuration error when I try to compile/build the program. A message is showing the configuration as deprecated. I'm using jdk 8 and jre 8 and using eclipse neon as my ide. Please help me to execute the program
