You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I'm new to Java development, so I apologize in advance if the question turns out to be stupid, but I couldn't find an answer to my question on the Internet.
I need to create an HTML page by template to send it for printing via JavaFX modules. However, if the module-info file is present in the project, then an error appears during the compilation of the project:
G:\tmp.work\demo2\jte-classes\gg\jte\generated\ondemand\JteexampleGenerated.java:2: error: package com.example.demo2 does not exist
import com.example.demo2.Body;
^
G:\tmp.work\demo2\jte-classes\gg\jte\generated\ondemand\JteexampleGenerated.java:6: error: package gg.jte.html does not exist
public static void render(gg.jte.html.HtmlTemplateOutput jteOutput, gg.jte.html.HtmlInterceptor jteHtmlInterceptor, Body page) {
^
G:\tmp.work\demo2\jte-classes\gg\jte\generated\ondemand\JteexampleGenerated.java:6: error: package gg.jte.html does not exist
public static void render(gg.jte.html.HtmlTemplateOutput jteOutput, gg.jte.html.HtmlInterceptor jteHtmlInterceptor, Body page) {
^
G:\tmp.work\demo2\jte-classes\gg\jte\generated\ondemand\JteexampleGenerated.java:6: error: cannot find symbol
public static void render(gg.jte.html.HtmlTemplateOutput jteOutput, gg.jte.html.HtmlInterceptor jteHtmlInterceptor, Body page) {
^
symbol: class Body
location: class JteexampleGenerated
G:\tmp.work\demo2\jte-classes\gg\jte\generated\ondemand\JteexampleGenerated.java:28: error: package gg.jte.html does not exist
public static void renderMap(gg.jte.html.HtmlTemplateOutput jteOutput, gg.jte.html.HtmlInterceptor jteHtmlInterceptor, java.util.Map<String, Object> params) {
^
G:\tmp.work\demo2\jte-classes\gg\jte\generated\ondemand\JteexampleGenerated.java:28: error: package gg.jte.html does not exist
public static void renderMap(gg.jte.html.HtmlTemplateOutput jteOutput, gg.jte.html.HtmlInterceptor jteHtmlInterceptor, java.util.Map<String, Object> params) {
^
G:\tmp.work\demo2\jte-classes\gg\jte\generated\ondemand\JteexampleGenerated.java:11: error: package gg.jte.runtime does not exist
if (gg.jte.runtime.TemplateUtils.isAttributeRendered(__jte_html_attribute_0)) {
^
G:\tmp.work\demo2\jte-classes\gg\jte\generated\ondemand\JteexampleGenerated.java:29: error: cannot find symbol
Body page = (Body)params.get("page");
^
symbol: class Body
location: class JteexampleGenerated
G:\tmp.work\demo2\jte-classes\gg\jte\generated\ondemand\JteexampleGenerated.java:29: error: cannot find symbol
Body page = (Body)params.get("page");
^
symbol: class Body
location: class JteexampleGenerated
9 errors
at gg.jte@3.1.9/gg.jte.compiler.java.JavaClassCompiler.runCompiler(JavaClassCompiler.java:49)
at gg.jte@3.1.9/gg.jte.compiler.java.JavaClassCompiler.compile(JavaClassCompiler.java:38)
at gg.jte@3.1.9/gg.jte.compiler.TemplateCompiler.precompileClasses(TemplateCompiler.java:114)
at gg.jte@3.1.9/gg.jte.compiler.TemplateCompiler.precompile(TemplateCompiler.java:94)
at gg.jte@3.1.9/gg.jte.compiler.TemplateCompiler.load(TemplateCompiler.java:50)
at gg.jte.runtime@3.1.9/gg.jte.TemplateEngine.lambda$resolveTemplateOnDemand$0(TemplateEngine.java:354)
at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916)
at gg.jte.runtime@3.1.9/gg.jte.TemplateEngine.resolveTemplateOnDemand(TemplateEngine.java:347)
at gg.jte.runtime@3.1.9/gg.jte.TemplateEngine.resolveTemplate(TemplateEngine.java:337)
at gg.jte.runtime@3.1.9/gg.jte.TemplateEngine.render(TemplateEngine.java:210)
at com.example.demo2/com.example.demo2.Main.main(Main.java:16)
There is no error without the module-info.java file and everything functions as expected.
Please tell me how to modify the module-info file.java or my code to make project compiles without an error? Thanks!
I haven't used Java modules seriously so far, so have no pointer for you in the right direction.
I guess the Java Compiler would need a hint to allow access of your module, when compiling jte files.
There is this method TemplateEngine#setCompileArgs. Maybe you can specify there that this module is accessible?
First of all, I would like to thank you very much for your response! After doing some research, I found the "precompilation" feature on the "gg.jte" web page and decided to use it through the "Maven" plugin. Everything is working as expected!
Hi! I'm new to Java development, so I apologize in advance if the question turns out to be stupid, but I couldn't find an answer to my question on the Internet.
I need to create an HTML page by template to send it for printing via JavaFX modules. However, if the module-info file is present in the project, then an error appears during the compilation of the project:
There is no error without the module-info.java file and everything functions as expected.
Please tell me how to modify the module-info file.java or my code to make project compiles without an error? Thanks!
Current file module-info.java is
Project structure:
Executable code:
JDK Version - 17
JTE Version - 3.1.9
The text was updated successfully, but these errors were encountered: