JDK8 minimal Jasper compiler version - java-8

what is the minimal version of jasper-compiler.jar file and servlet-api.jar required, for avoiding compile time errors with JDK8 ?
I am getting following Errorlogs when compiled with JDK8:
Caused by: org.apache.jasper.JasperException: Unable to compile class for JSP
Generated servlet error:
The type java.util.regex.Pattern cannot be resolved. It is indirectly referenced from required .class files
Generated servlet error:
The import java.util.regex.Pattern cannot be resolved

OK, I found it in the TIBCO JasperReports Server v6.1.0 Release Notes:
New Platform Support
JasperReports Server now supports:
Java 8 as a JDK

Related

Java 11 with gradle: must specify an absolute path but is ${tools.jar}

We are moving from Java 8 to 11 on a project using jaxb. As it has been removed from the JDK, it has to be included separately, which I have done via gradle config:
compile("javax.xml.bind:jaxb-api:2.2.11")
compile("com.sun.xml.bind:jaxb-core:2.2.11")
compile("com.sun.xml.bind:jaxb-impl:2.2.11")
I am able to run the project, however compileJava gradle job throws errors:
Errors occurred while build effective model from C:\Users\.\.gradle\caches\modules-2\files-2.1\com.sun.xml.bind\jaxb-core\2.2.11\db0f76866c6b1e50084e03ee8cf9ce6b19becdb3\jaxb-core-2.2.11.pom:
'dependencyManagement.dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${tools.jar} in com.sun.xml.bind:jaxb-core:2.2.11
Errors occurred while build effective model from C:\Users\.\.gradle\caches\modules-2\files-2.1\com.sun.xml.bind\jaxb-impl\2.2.11\2d4b554997fd01d1a2233b1529b22fc9ecc0cf5c\jaxb-impl-2.2.11.pom:
'dependencyManagement.dependencies.dependency.systemPath' for com.sun:tools:jar must specify an absolute path but is ${tools.jar} in com.sun.xml.bind:jaxb-impl:2.2.11
The job finishes and there is a jar created, however when run on production server it stops with this error:
java.lang.NoClassDefFoundError: javax/xml/bind/Unmarshaller$Listener
I'm using Spring Boot v1.5.6 and gradle 4.8.1
The solution is to use a newer version of the jaxb libraries. 2.3.0 is no longer using tools.jar.

java.lang.ExceptionInInitializerError is produced when lombok is used within a Spring-boot application

When I am using lombok within a spring-boot application java: java.lang.ExceptionInInitializerError is produced. What can I do to prevent this error?
What have I done?
I've installed lombok plugin in IntelliJ and restarted it after installing plugin.
I've enabled Annotation Processors from both
File->Setting and Filer->Other Setting->Default-> setting->Build, Execution and deployment->Compiler->Annotation Processors
File->Setting and Filer->Setting->Build, Execution and deployment->Compiler->Annotation Processors
I've also tried to change the scope of dependency in the pom.xml to 'provided'
I tried other versions of lombok such as 1.16.21, 1.14 and ... but when I change the version other errors occur (For example when I change the version to the 1.16.16, Compiler says 'java package lombok dose not exists.')
Errors with different versions:
1.16.21: java.lang.ExceptionInInitializerError
1.16.20: java.lang.ExceptionInInitializerError
1.16.19: java.lang.ExceptionInInitializerError
ver < 1.16.18: java: package lombok does not exist
other info:
JDK: 10
Spring-boot: 2.0.2.RELEASE
OS: Windows and Linux
The amount of boilerplate code (setter and getters) is really high in my code, and I really need lombok what can I do to use it?
.
The problem has been solved in Lombok version 1.18.0
There is known issue with lombok and Java 10: https://github.com/rzwitserloot/lombok/issues/1572. Should be fixed with 1.16.22 version.

Getting unresolved reference error in Kotlin Android Library Project

I am getting unresolved reference error in Kotlin Android Library project.
1.) standard_kotlin_lib.jar --> contains: Kotlin classes, META-INF/standard_kotlin_lib.kotlin_module
2.) A.aar --> compiles only standard_kotlin_lib.jar file. After compilation, inside generated A.aar file’s classes.jar: META-INF/standard_kotlib_lib.kotlin_module is missing, infect whole META-INF is missing
3.) B.aar --> compiles A.aar. Here, kotlin source code importing classes define in “standard_kotlin_lib.jar”. Getting unresolved reference error at import
B.aar <-- A.aar <-- standard_kotlin_lib.jar
Tools Version:
1.) I am using android gradle plugin 3.0.0 and gradle version 4.3.0. With previous plugin version i.e. 2.2.3 and gradle version 3.2.1, this error was not coming. Kotlin version is 1.1.4
Issue I think:
1.) META-INF is missing inside A.aar file. When I manually copy the META-INF inside A.aar’s classes.jar, B.aar compiled successfully.

Tycho build fails with with java 6

I need to compile a an eclipse RCP using maven+tycho, at the moment everything is working fine, as I configured this on my local PC.
When switching to production-building configuration, it fails, the only difference being java version used.
Works with: Java jdk1.8.0_25
Fails with: Java jdk1.6.0_45
Error message:
ATTENTION: Error injecting: org.eclipse.tycho.core.p2.P2ArtifactRepositoryLayout
java.lang.TypeNotPresentException: Type org.eclipse.tycho.core.p2.P2ArtifactRepositoryLayout not present
...
...
...
Caused by: java.lang.UnsupportedClassVersionError: org/eclipse/tycho/core/p2/P2ArtifactRepositoryLayout : Unsupported major.minor version 52.0
I can provide the full error stack if needed, but the error message seems pretty explicit already. Still, didn't find anything about it on the web, because it feels strange that this can't be done using java 1.6.
When using java jdk 8, I don't have any errors and the build is working fine till the end.
Recent versions of Tycho require Java 8 (.class file version 52.0 means Java 8). You can, however, still build against an older Java (and run tests with an older Java) using a feature called toolchains. That way, mvn runs on Java 8, while your code is compiled against Java 6.

How do I include a java 9 module at runtime?

I have a server kit that I'm trying to test on the java9 JDK (found here, I'm using the 64-bit Linux version), however I'm encountering the following error shortly after startup:
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:533)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:186)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:476)
The server kit starts without issue when using java8. Somehow I need to tell the runtime system to include the javax.xml.bind module, however I'm new to java9 and don't know how to do this short of recompiling the entire server kit into a module and adding a dependency on the javax.xml.bind module. Is there a way to resolve this error that doesn't require me to recompile the server kit into a module?
Java EE modules are shipped with the JDK but not resolved by default and java.xml.bind is one of them. In such cases they need to be included explicitly with --add-modules.
In your case, launch with --add-modules java.xml.bind.

Resources