I am using logback-classic 1.3.5 in my project but it is giving me UnsupportedOperationException. My project is on JDK 8 and when I saw in manifest file of logback-classic-1.3.5, it shows build-jdk-spec version as 19. I just want to know what exactly this "build-jdk-spec" version specifies
The build-jdk-spec attribute is a "default" attribute added by the Maven "maven-archiver-plugin" (reference). The value is the value of the ${java.specification.version} property for the build. It is (I think) the JDK version of the JVM that was running the build tool (Maven).
The [build-jdk-spec] version number most likely doesn't signify anything that is relevant to your problem. (It is NOT the the target Java version for the build!!)
The real cause of your problem can be deduced by looking at the details of the UnsupportedOperationException stacktrace.
Related
I work on a large set of Maven-built services with a parent pom that uses a BOM using version ranges. In general, this works perfectly fine, when the available version is NOT a snapshot.
I'm now working on some new code that uses the same mechanism, but the only available version is a SNAPSHOT version. When I run the Maven build, it says "no versions available".
My version range is "[2.9.0, 2.9.100]". The available version is 2.9.0-SNAPSHOT, and that fails.
In a related version, using a version range of "[2.7.0, 2.7.100)", when the available version is 2.7.0 or 2.7.1, this works fine.
From what I've read, I believe it implies that "2.9.0-SNAPSHOT" is "more than" 2.9.0, so this should work. Just in case, I tried an experiment of changing the range to "[2.8.9, 2.9.100)", but it still says there is no version available.
I'm aware of the advice that "version ranges are not recommended". In general, this works for us. Do snapshots not work with version ranges?
I'm presently using Maven v3.8.2.
Update:
Note that if I change the version range to "[2.9.0-SNAPSHOT, 2.9.100-SNAPSHOT)", it does accept the "2.9.0-SNAPSHOT" version. I'm not sure if that helps in the long run.
Here's what you can do: java -jar maven-artifact.jar n1 n2 n3 ... nx
The maven-artifact jar that's part of every Maven distribution is also an executable jar, where you can add version numbers. E.g.
D:\>"%JAVA_HOME%"\bin\java -jar d:\apache-maven-3.8.1\lib\maven-artifact-3.8.1.jar 2.9.0 2.9.0-SNAPSHOT
Display parameters as parsed by Maven (in canonical form) and comparison result:
1. 2.9.0 == 2.9
2.9.0 > 2.9.0-SNAPSHOT
2. 2.9.0-SNAPSHOT == 2.9-snapshot
The rational: 2.9.0-SNAPSHOT will result in 2.9.0, hence the SNAPSHOT is before/smaller and will not be included if you o [2.9.0 .
Here's the related javadoc: https://maven.apache.org/resolver/apidocs/org/eclipse/aether/util/version/GenericVersionScheme.html
I'm confused as how to change a specific configuration somewhere to determine the version of my gradle, in a nativescript project.
My workspace is created with nx and when I try to run the app with npx nx run test:android I get this error message:
Could not compile settings file '<somepath>\start\learn\apps\nativescript-test\platforms\android\settings.gradle'.
> startup failed:
General error during conversion: Unsupported class file major version 62
Based on my research if I need to resolve this issue I need to either update my gradle version or downgrade my JDK version. The solution I'm searching for is to how to specify my gradle version.
Thanks in advance.
based on my understanding version of gradle is defined by #nativescript/android package (read its README.md), so if updating the #nativescript/android doesn't help do the next steps
1- install jdk 18 -> because its the first version that supports major version 62
2- add JAVA_HOME to env vars
3- in platform/gradle.properties add org.gradle.java.home=C:\\Program Files\\Java\\jdk-18.0.1 (because in my case gradle didn't read form JAVA_HOME)
4- change platform/gradle-wrapper gradle version to 7.4.2
5- in platform/build.gradle do this: replace whatever version of plugin to classpath 'com.android.tools.build:gradle:7.2.0'
I'm compiling a JNI library with Gradle. It clearly knows how to find a JDK (as the Java half of the project compiles perfectly). However, I'd need a path to the JNI header files in a Gradle native (C++) project.
Is there a way to obtain the path of the JDK being used from a Gradle build file?
According to the top reply here, you can get currently running Java path from the property java.home. In Gradle:
println System.getProperty('java.home')
or more Groovy:
println System.properties.'java.home'
Since this is the top answer on Google:
Jvm.current().getJavaHome()
Note that the JVM class is internal as of Gradle 6, use it at your own risk.
I'm using IntellJ 14.1.4 Community Edition
My project compiled fine before (I have it set up to use the Eclipse compiler)
But I tried to Mavenize it...
I added Maven via the Add Framework | Maven command
Now my problem is (still using the Eclipse Compiler)...
It gives me error messages like:
Error:(21, 78) java: '<>' operator is not allowed for source level below 1.7
Which leads me to suspect that it is not compiling to 1.8
However, I didn't change anything other than Mavenizing it
The Project SDK in IDEA is set to use 1.8
I did notice some setting about bytecode being 1.5.. but i tried to change that to 1.8 but still get this error message.
Anyone have any clue what's going on?
this was essentially the correct advice of course - in the comments, however I had been trying to do it for a long time both via maven-compiler-plugin and properties... to no success, even though I was refreshing Maven after making changes to pom.xml. Finally, I restarted the IDE .. and .. it works! I can compile..
I have recently updated my STS from 2.5.2 to 2.6. Since then, each grails project shows an error in the conf/spring/resources.groovy file reading: Description Resource Path Location Type
Internal compiler error: java.lang.VerifyError: (class: org/codehaus/jdt/groovy/internal/compiler/ast/JDTClassNode, method: initialize signature: ()V) Bad access to protected data at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.createClassNode(JDTResolver.java:461) resources.groovy /GrailsProject/grails-app/conf/spring line 0 Java Problem
The resources.groovy file is as good as empty (in default state), and if I delete it, the error is shown on the DataSource.groovy, so the file itself seems not to be the cause.The used groovy compiler version is 1.7.3.I have made a clean STS 2.6 install, installed the groovy and grails plugins and got the same error.What could be the problem? And is there a solution to this not resulting in downgrading to 2.5.2 again? Thank you
Take a look at your preferences Groovy -> Compiler. Are you by any chance accidentally using Groovy 1.6?
EDIT
That didn't solve the problem, but as described in http://forum.springframework.org/showthread.php?p=357361, upgrade to the latest dev build of Groovy-Eclipse as well as Grails Tooling and that should work.