Cannot build JXBrowser jar with v6.18+ - java

I am getting some errors that had been fixed according to the 6.18 release notes and was hoping to bump the dependency version to fix the issue, but when I mvn install the project now, I get a build error
Classes found in the wrong directory: {META-INF/versions/9/com/teamdev/jxbrowser/chromium/swing/internal/AWTHelper$1.class=com.teamdev.jxbrowser.chromium.swing.internal.AWTHelper$1, META-INF/versions/9/com/teamdev/jxbrowser/chromium/swing/internal/NativeLinux.class=com.teamdev.jxbrowser.chromium.swing.internal.NativeLinux, META-INF/versions/9/com/teamdev/jxbrowser/chromium/javafx/internal/NativeMac.class=com.teamdev.jxbrowser.chromium.javafx.internal.NativeMac, META-INF/versions/9/com/teamdev/jxbrowser/chromium/javafx/internal/dialogs/ColorDialog.class=com.teamdev.jxbrowser.chromium.javafx.internal.dialogs.ColorDialog, META-INF/versions/9/com/teamdev/jxbrowser/chromium/internal/JavaVersion.class=com.teamdev.jxbrowser.chromium.internal.JavaVersion, META-INF/versions/9/com/teamdev/jxbrowser/chromium/swing/internal/AWTHelper.class=com.teamdev.jxbrowser.chromium.swing.internal.AWTHelper, META-INF/versions/9/com/teamdev/jxbrowser/chromium/swing/internal/Native.class=com.teamdev.jxbrowser.chromium.swing.internal.Native, META-INF/versions/9/com/teamdev/jxbrowser/chromium/internal/X509CertificateFactory.class=com.teamdev.jxbrowser.chromium.internal.X509CertificateFactory, META-INF/versions/9/com/teamdev/jxbrowser/chromium/swing/internal/AWTHelper$InstanceHolder.class=com.teamdev.jxbrowser.chromium.swing.internal.AWTHelper$InstanceHolder, META-INF/versions/9/com/teamdev/jxbrowser/chromium/javafx/internal/Native.class=com.teamdev.jxbrowser.chromium.javafx.internal.Native, META-INF/versions/9/com/teamdev/jxbrowser/chromium/internal/OS.class=com.teamdev.jxbrowser.chromium.internal.OS}
I have cleared my maven cache and tried versions 6.18-6.20 but I can only build with 6.17 and below. My license file claims to work for versions 6.X, so I would assume that is not the issue.
Thanks!

Starting from the version 6.18, JxBrowser provides multi-release jars, so it is able to work with both Java 8 and Java 9. And it seems that the maven used to build the application does not support the MR-JAR's, so it generates a build error. So you need to upgrade Maven version.

Related

Why is IntelliJ IDEA unable to determine java version?

I'm rather new to IntelliJ IDEA and Grails in general. I just started a new Project, selected my project JDK (11.0.1) and Gradle distribution (4.10.2). Whenever I try to run the project, I get this error:
Error initializing classpath: Could not determine java version from
'11.0.1'. java.lang.IllegalArgumentException: Could not determine java
version from '11.0.1'. at
org.gradle.api.JavaVersion.toVersion(JavaVersion.java:68) at
org.gradle.api.JavaVersion.current(JavaVersion.java:78) at
org.gradle.internal.jvm.UnsupportedJavaRuntimeException.assertUsingVersion(UnsupportedJavaRuntimeException.java:29)
at
org.gradle.tooling.internal.consumer.ConnectorServices.checkJavaVersion(ConnectorServices.java:66)
at
org.gradle.tooling.internal.consumer.ConnectorServices.close(ConnectorServices.java:53)
at
org.gradle.tooling.internal.consumer.DefaultGradleConnector.close(DefaultGradleConnector.java:57)
at
org.grails.cli.gradle.cache.CachedGradleOperation.call(CachedGradleOperation.groovy:78)
at
org.grails.cli.GrailsCli.populateContextLoader(GrailsCli.groovy:525)
at org.grails.cli.GrailsCli.initializeProfile(GrailsCli.groovy:508)
at
org.grails.cli.GrailsCli.initializeApplication(GrailsCli.groovy:306)
at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:269) at
org.grails.cli.GrailsCli.main(GrailsCli.groovy:159)
All other discussions of the problem I found suggested changing the Gradle distribution, which I already did. I would be so happy if anybody could help me out here.
Cheers!
May be your java configuration is not correct. If not correct follow this steps.
Goto File-> Project Structure.
Change SDK
Or gradle version is not matching jdk 11 then skip this answer.
Besides the issue with Gradle above, if you're trying to run a Grails project I don't think you can do that with JDK higher than version 8.
Even the latest Grails (3.3.8 as of this writing) is still based on SpringBoot 1.5 which does not support newer JDK, I don't know if there's a special trick to make it work.
I had to delete the .gradle directory and restart Intellij.

How to use Jenkins 2.63 with jobs which should be built using Java 1.7?

we have a Jenkins job which is/was configured to use JDK7. Upon inspecting the logs, i noticed following ERRORs:
ERROR: Invalid project setup: jenkins/security/MasterToSlaveCallable : Unsupported major.minor version 52.0
ERROR: [JENKINS-18403][JENKINS-28294] JDK 'JDK 1.7.0_45' not supported to run Maven projects.
ERROR: Maven projects have to be launched with a Java version greater or equal to the minimum version required by the master.
ERROR: Use the Maven JDK Toolchains (plugin) to build your maven project with an older JDK.
ERROR: Retrying with slave Java and setting compile/test properties to point to /usr/java/jdk1.7.0_45/.
After some googling it seems that there is some interaction between the Job and Jenkins itself. Since Jenkins is started with JDK8 and the Job with JDK7 it seems to produce this ERROR. The build is OK, because Jenkins then proceeds to build with JDK8. But we actually want this built with 1.7.
So the question is:
If we start Jenkins with JDK8, how can i get the Jobs to compile with JDK7 without this error?
this is apparently a technical limitation of Jenkins plugin Maven Integration.
Because java serialized classes are exchanged between Jenkins master and Maven Jobs it is required that the JVM used to launch Maven is superior or equal to the version of Java for which Jenkins Master is built for.
I suspect that you have a Jenkins version too recent, requiring a JDK version >= 8.
As the required version was 7, you could either use java 7 or 8 - or even 9. So your build succeeded with Java7, even if your Jenkins was started with Java8.
You can either downgrade your Jenkins installation, or move all your builds to Java8.
Cheers
For using Java 1.7 on Jenkins >= 2.54 you need to transform the Maven project in a Free-style project. In the Free-style project you can specify the JDK version. This is because starting from version 2.54, Jenkins was upgraded to use Java 8.
From Jenkins release notes:
Using the Maven project type with Java 7
Users with jobs configured with the "Maven project" type may not be
able to use Java 7 for their Maven jobs. The correct behavior is not
guaranteed so proceed at your own risk. The Maven Project uses Jenkins
Remoting to establish "interceptors" within the Maven executable.
Because of this, Maven uses Remoting and other Jenkins core classes,
and this behavior may break an update
You can also see here how to create a Free-style project
As you might probably know Jenkins >= 2.54 requires Java >= 8 thus Maven jobs must be launched with Java >= 8
Besides that the Error message is guiding you with:
Use the Maven JDK Toolchains (plugin) to build your maven project...
Using that plugin would probably help you to run your jenkins job using Java 8 and also compile your project files using Java 7.
I resolved my problem this way some years ago.
You can see more details on this Answer.
The interaction is based on that Jenkins will try to be informed about finishing single modules and if there are artifacts being created and some other stuff. This is handled by a EventSpy implementation in Jenkins. That can cause issues like this.

custom rules are not shown in the dashboard

I'm writing a custom rules for java, following the tutorial http://docs.sonarqube.org/display/PLUG/Writing+Custom+Java+Rules+101
I've build the maven project successfully, and moved the jar to the folder /extenstions/plugins/ ,and I restarted the sonar service, but I cannot find out the rule I wrote in the rules page.
I thought about I have the wrong version of the software. I've checked the version I use. sonarqube is 5.3, sonarscanner is 2.5, java version is 1.8, maven version is 3.0.5. I've downloaded the java-plugin-4.1.jar from the website and put it into the folder /extensions/plugins/
Finally Like Michael said the java-plugin version and the sonarqube version doesn't match very well. I upgraded the sonarqube and mysql, the rule finally come into effect. Thank you Michael.

Golang plugin on Intellij

I want to use Intellij 13.1.6 as my go app IDE, but there are some problem I can't sovle yet.
The default version of go support plugin installed on Intellij is 0.9.15, but in this version, there are some bugs so that I can build project successfully.
So I try to build the go-plugin jar by myself follow this article:
https://content.pivotal.io/blog/setting-up-the-google-go-plugin-with-intellij-idea-13-on-os-x-10-8-5
But when I click Prepare Plugin Module 'google-go-language' For Deployment, it shows errors cause some method can't be found. As the following figure
I think the problem is the version of my Intellij lack of some lib so that I can't build go-plugin jar successfully. How do I fix this?
Appreciate any replies.
Intellij Version: 13.1.6
JDK Version: 1.7
Go-plugin on GitHub: the latest commit on master branch (0261ffa)
The latest version of the Go plugin code requires IntelliJ IDEA 14.

Errormessage caused by Maven plugin manager - what is the reason?

I get a obscure error meesage, if i want to build my maven project with command "maven clean install":
Internal error in the plugin manager executing goal 'com.samaxes.maven:minify-maven-plugin:1.7:minify': Unable to find the mojo 'minify' (or one of its required components) in the plugin 'com.samaxes.maven:minify-maven-plugin'
com/samaxes/maven/minify/plugin/MinifyMojo : Unsupported major.minor version 51.0**
Was anybody an idea, how i can solve this problem?
//EDIT
It is possible to solve this problem without changing the current JDK 6 to JDK 7 ?
//EDIT again
Ok i could build my maven project. I have done the follwoing step but i´m not sure, if this was a good way of solution:
<plugin>
<groupId>com.samaxes.maven</groupId>
<artifactId>minify-maven-plugin</artifactId>
<version>1.6</version>
</plugin>
I have changed the version from 1.7 to 1.6 and now i can build the maven project. But is that really the best solution?
The plugin is compiled for Java 1.7 and you don't have a JDK7 installed (at least Maven is not running with that JDK)
This plugin was compiled for Java 7 and your system has previous Java version. Hence the problem with running MinifyMojo
As others have mentioned, this plugin is compile for Java 7. You can either upgrade your version of Java or you can check if any of the previous versions of your plugin were compiled with Java 6, or at least were compiled with Java 6 compatibility turned on.

Categories