How to make java Module JAR execute by clicking - java-module

I am using OpenJDK 11 and OpenJFX 11 on Windows 7. My IDE is Netbeans 9. I have replicated the tutorial (published by NetbeansVideos) below :
JDK 11, OpenJFX, Apache Ant, and Apache NetBeans 10
It is a simple Hello World type code. It works in Netbeans. But when I click the JAR file it doesn't work.
My JAVA_HOME in environment variable is set.
How do I make that Module JAR execute by clicking?
Thanks.

An archive becomes a modular JAR when you include a module descriptor,
module-info.class, in the root of the given directories or in the root
of the .jar archive.
-- https://docs.oracle.com/en/java/javase/17/docs/specs/man/jar.html
If you get your OpenJDK binaries from Adoptium, their installer has an option to associate .jar files. (Not sure about other distros) When you have the file association setup double clicking on a modular, executable, jar file behaves as expected. (Confirmed this is working as of JDK 17 and Windows 10). If not, you can manually setup the Windows file association yourself as described in: Running JAR file on Windows

Related

Installing the QT SQL driver for MySQL - How?

I have been using MySQL with QT C++ and it's working fine. Now I want to update to QT 6.3.0 and I need to re-do the procedure again.
So there are one man who pre-compile libarires for MySQL support for QT.
https://github.com/thecodemonkey86/qt_mysql_driver
He writes:
put qsqlmysql.dll (if release build) / qsqlmysqld.dll (if debug build, but note that when using MinGW 8.1.0 the debug build is named qsqlmysql.dll as well) in application subdirectory "sqldrivers"
put libmysql.dll (the MySQL library itself) and the OpenSSL v1.1 libraries, libcrypto-1_1 and libssl-1_1, in your application dir
Point 1 is easy to understand. I just move this one
To here:
But how should I place the .dll files in point 2 ? My application folder...yes...but should I just drop them ctrl+c -> ctrl+v ?
Please refer to the readme here: https://github.com/thecodemonkey86/qt_mysql_driver
Download .zip folder acoording to your QT version
put qsqlmysql.dll / qsqlmysqld.dll in application subdirectory "sqldrivers" (the folder within your qt version, eg. "QT/6.3.0/mingw_64/plugins/sqldrivers"
put libmysql.dll (the MySQL library itself) and the OpenSSL v1.1 libraries, libcrypto-1_1 and libssl-1_1, in your application dir (the folder where your debug project is located)
Rebuild your project (just remove your compiled project folder)
Should work now.

I am working with JDBC, and I have used mysql-connector 8 to run my java program from command line

When I am compiling the Java code, I have written the command line shows the following:
C:\HTML>javac Jdbc.java
Jdbc.java:5: error: package com.mysql does not exist
Class.forName(com.mysql.jdbc.Driver);
^
1 error
I have installed XAMPP and started the Apache, MySQL and Tomcat and they are working. I have installed MySQL Connector which is platform independent and latest. I have copied the JAR executable file to the JDK folder. I have added the jar executable file path in the edit system environment variables,
''' Class.forName(com.mysql.jdbc.Driver);'''
If you reference classes from a library, you should add that library to the classpath (i.e. javac -cp .;path\to\your\mysql-connector.jar Jdbc.java). However, that would immediately result in a different error, because that code should be Class.forName("com.mysql.jdbc.Driver") (passing a String).
Some further remarks:
I have copied the JAR executable file to the JDK folder.
You should never manually copy files to the JDK folder (in older versions there was the ext mechanism, but this no longer exists in recent Java versions). In addition, MySQL Connector/J is a library, not an executable jar.
I have added the jar executable file path in the edit system environment variables
Java JARs do not belong on the PATH. In theory you can add them to CLASSPATH environment variable, but that is generally considered a bad idea: most ways of executing Java do not actually use it, and if it does get used, it can result in unexpected behaviour because of conflicting or unexpected libraries on the classpath, etc.

APPX321 SDK folder containing 'UAP.props' for 'UAP 10.0.17763.0' cannot be located

I want to create an upload package for the Windows Store.
The app is essentially "Hello world" for a dev express XAF Win application. I am using the Desktop Bridge.
I am following the docs to create the upload package
This created a file
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage
And an error
APPX3217 SDK folder containing 'UAP.props' for 'UAP 10.0.17763.0'
cannot be located. See http://go.microsoft.com/fwlink/?LinkID=798187 for more information
When I double click the error it goes to the following code in the Targets file
<GetSdkPropertyValue Condition="'$(AppxPackagePipelineVersion)' == '$(UapBuildPipeline)'"
TargetPlatformSdkRootOverride="$(TargetPlatformSdkRootOverride)"
SDKIdentifier="$(SDKIdentifier)"
SDKVersion="$(SDKVersion)"
TargetPlatformIdentifier="$(TargetPlatformIdentifier)"
TargetPlatformMinVersion="$(TargetPlatformMinVersion)"
TargetPlatformVersion="$(TargetPlatformVersion)"
PropertyName="WindowsSdkDir"
VsTelemetrySession="$(VsTelemetrySession)">
I am targeting WIndows 10, version 1809(10.0; Build 17763) and also have this as the min version.
The application is using .Net Framework 4.7.2
As per the Microsoft link I had to install the update for Windows 10 SDK, version 1809.
My Logs :
Error APPX3217: SDK folder containing 'UAP.props' for 'UAP
10.0.18362.0' cannot be located.
This works for me.
Go to https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/
Install SDK: Windows 10 SDK, version 1903 (10.0.18362.1)
Then, rebuild it succeeded.
I had the same issue with a CI/CD project that relied on the 1703 release. I used choco to fix it as a build-step.
choco install windows-sdk-10.1 --version=10.1.15063.468

How to integrate findbugs 1.3.4 plugin with Myeclipse 8.0M1 offline

At my work place I don't have access to the internet, so I downloaded findbugs plugin version 1.3.4 (jar file) to integrate with Myeclipse version 8.0M1. I tried to integrate it by browsing the jar file from local archive but it is saying no repository found. I tried by copying the jar file to eclipse install directory in plug-in folder also but of no use.
Regardless of Lonzak's personal opinion, MyEclipse is still widely used but release 8 is very old and based on a very old release of eclipse.
However, it looks like you're using an incorrect method to install the plug-in, though you don't give exact steps. The error you mention indicates that the file you browsed to isn't a valid eclipse update site (assumed to be archived as a file, in this case). That seems right, if you've downloaded the plug-in from sourceforge.
Instead, extract the zip file to the dropins folder. In later releases of MyEclipse, the dropins folder would be in the installation folder for the profile (i.e. not the Common folder but the folder for the specific ME release, where the myeclipse.exe file is). I assume it is in the same place in release 8 but can't check.
I don't know which release of FindBugs is compatible with ME 8, so you're on your own there.

FlashDevelop Configuration Issue - demands Java 1.6

I've been using Flashdevelop (version 4.4) for some time now with zero problems. I recently reinstalled Windows 7 however, and after installing Flashdevelop it is demanding Java 1.6 and won't compile without it. Let me be more specific, here is the error I get when I try to compile a simple HelloWorld-type test:
"Running process: C:\Program Files (x86)\FlashDevelop\Tools\fdbuild\fdbuild.exe "C:\Users\marc\Documents\DeleteMe\DeleteMe\DeleteMe.as3proj" -ipc 01be003c-6cb5-4d0b-9c35-c59dd2ea7a19 -version "4.6.0; 3.3" -compiler "C:\Program Files (x86)\FlashDevelop\Tools\flexsdk" -library "C:\Program Files (x86)\FlashDevelop\Library" -cp "C:\Program Files (x86)\Java\jdk1.6.0_34\bin" -cp "C:\Program Files (x86)\Java\jdk1.6.0_34"
Building DeleteMe
mxmlc -load-config+=obj\DeleteMeConfig.xml -debug=true -incremental=true -swf-version=16 -o obj\DeleteMe634829909556672047
Starting java as: C:\Program Files (x86)\Java\jdk1.6.0_34\bin\java.exe;\bin\java.exe
Unable to start java.exe: The system cannot find the file specified
Could not compile because the fcsh process could not be started.
Build halted with errors (fcsh).
INITIALIZING: Failed, unable to run compiler
Done(1)"
The GlobalClasspath setting for the Java 1.6 JDK is set to: C:\Program Files (x86)\Java\jdk1.6.0_34\bin
I have also set my JAVA_HOME environment variable to the same location as well. Might I be neglecting to set another environment variable?
JAVA_HOME should be
C:\Program Files (x86)\Java\jdk1.6.0_34
and not
C:\Program Files (x86)\Java\jdk1.6.0_34\bin
FlashDevelop currently doesn't support that your JAVA_HOME environment var contains several paths (C:\Program Files (x86)\Java\jdk1.6.0_34\bin\java.exe, \bin\java.exe).
Modify it to only indicate the first path (C:\Program Files (x86)\Java\jdk1.6.0_34\bin\java.exe).
As someone who was dealing with this, I just found an answer that doesn't involve mucking with the PATH variables.
Go into your Flex SDK, /bin directory, look for the JVM config file conveniently named jvm.config
Inside, there is a param 'java.home' which, if left empty, will cause it to search for it's own value. Enter in the main path to the JRE - in my case,
java.home=C:\Program Files\Java\jre1.6.0_07\
I found mine by going to "Control Panel > Java > Java tab > View... button" to see all the installed versions and their paths
I prefer this method because I feel like you shouldn't have to modify settings on your whole system to get 1 program to work, if you have the option instead to just modify that program's settings.
jvm.config in C:\Program Files (x86)\FlashDevelop\Tools\flexsdk\bin\jvm.config is much more better than path variable.
Please avoid Path variable.
In jvm.config just set jre URL directory
java.home=C:\Program Files\Java\jre1.6.0_07
May be you update the Java, last version of Java ask you to delete older version. Then go into the file
C:\Program Files (x86)\FlashDevelop\Tools\flexsdk\bin\jvm.config
and replace
java.home=C:\Program Files\Java\jre1.6.0_07\
by the folder were is your new version
java.home=C:\Program Files (x86)\Java\jre1.8.0_25\