I have the following set-up:
$ qmake --version
QMake version 3.1
Using Qt version 5.9.5
I am using CMake with the following relevant instructions (to give you a context):
set(CMAKE_PREFIX_PATH /usr/lib/qt5/bin/)
if(CMAKE_VERSION VERSION_LESS "3.7.0")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
endif()
set(CMAKE_MODULE_PATH /usr/lib/qt5)
# #see: https://stackoverflow.com/questions/51994603/cmake-qt5-undefined-reference-to-qprinterqprinterqprinterprintermode
SET(QT5_MODULES Core Widgets PrintSupport)
find_package(Qt5 COMPONENTS ${QT5_MODULES} REQUIRED)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(HW_GUI_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gui)
# include_directories(${HW_HEADER_DIR})
set(CMAKE_AUTOUIC ON)
...
The core part is
SET(QT5_MODULES Core Widgets PrintSupport)
find_package(Qt5 COMPONENTS ${QT5_MODULES} REQUIRED)
Now, when I add Quick or QuickControls2 into the QT5_MODULES, CMake cannot find those,
and I see this error on the cmake-config step:
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake:28
(find_package): Could not find a package configuration file provided
by "Qt5Quick" with any of the following names:
Qt5QuickConfig.cmake
qt5quick-config.cmake
Now, not to confuse you, /usr/lib/x86_64-linux-gnu/qt5/bin seems to be a symlink
to /usr/lib/qt5, which I've checked like this:
$ ls -l /usr/lib/x86_64-linux-gnu/qt5/bin/
total 0
lrwxrwxrwx 1 root root 33 Oct 30 18:00 fixqt4headers.pl -> ../../../qt5/bin/fixqt4headers.pl
lrwxrwxrwx 1 root root 20 Oct 30 18:00 moc -> ../../../qt5/bin/moc
lrwxrwxrwx 1 root root 29 Oct 30 18:00 qdbuscpp2xml -> ../../../qt5/bin/qdbuscpp2xml
lrwxrwxrwx 1 root root 29 Oct 30 18:00 qdbusxml2cpp -> ../../../qt5/bin/qdbusxml2cpp
How to fix this error and find the Quick module? What is special about it -- I am able to load the other modules allright.
First, please check if you have installed the correct packages providing those modules. Since you seem to be using some Debian derivative, these are the package names that you should install: qtdeclarative5-dev and qtquickcontrols2-5-dev. See:
https://packages.debian.org/sid/amd64/qtdeclarative5-dev/filelist
https://packages.debian.org/sid/amd64/qtquickcontrols2-5-dev/filelist
Related
I have a runnable jar (drkodi-mac-aarch64.jar), that should contain all that is needed, including the FX components.
I can successfully start the app by executing the following command:
java -jar drkodi-mac-aarch64.jar
My java installation:
java -version
openjdk version "18.0.1" 2022-04-19
OpenJDK Runtime Environment Temurin-18.0.1+10 (build 18.0.1+10)
OpenJDK 64-Bit Server VM Temurin-18.0.1+10 (build 18.0.1+10, mixed mode)
Now, I bundle this runnable jar into a Mac App, which contains a JRE and a launcher.
file DrKodi.app/Contents/MacOS/launcher-macosx-aarch64.sh
DrKodi/DrKodi.app/Contents/MacOS/launcher-macosx-aarch64.sh: POSIX shell script text executable, ASCII text
cat DrKodi.app/Contents/MacOS/launcher-macosx-aarch64.sh
cd "$(dirname "$0")" || exit
../Plugins/jre/Contents/Home/bin/java -jar "../Resources/Java/drkodi-mac-aarch64.jar"
The JRE is located here:
DrKodi/DrKodi.app/Contents/PlugIns/jre/Contents/Home
It is created using the following command:
Creating JRE with next modules included: java.base,java.logging,java.desktop,jdk.unsupported,java.scripting
[INFO] Using /Library/Java/JavaVirtualMachines/temurin-18.jdk/Contents/Home/jmods modules directory
[INFO] Executing command: /bin/sh -c cd '/Users/alex/sources/drkodi/.' && '/Library/Java/JavaVirtualMachines/temurin-18.jdk/Contents/Home/bin/jlink' --module-path /Library/Java/JavaVirtualMachines/temurin-18.jdk/Contents/Home/jmods --add-modules java.base,java.logging,java.desktop,jdk.unsupported,java.scripting --output /Users/alex/sources/drkodi/target/DrKodi/DrKodi.app/Contents/PlugIns/jre/Contents/Home --no-header-files --no-man-pages --strip-debug --compress=2
[INFO] Removing folder [/Users/alex/sources/drkodi/target/DrKodi/DrKodi.app/Contents/PlugIns/jre/Contents/Home/legal]
[INFO] JRE bundled in /Users/alex/sources/drkodi/target/DrKodi/DrKodi.app/Contents/PlugIns/jre/Contents/Home!
Now, when I start the App using the bundled java executable, like this:
./DrKodi.app/Contents/PlugIns/jre/Contents/Home/bin/java -jar ./DrKodi.app/Contents/Resources/Java/drkodi-mac-aarch64.jar
I get the following exception:
java.lang.RuntimeException: No toolkit found
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:280)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
If I start the jar file using my installed JRE, like follows, it works:
java -jar ./DrKodi.app/Contents/Resources/Java/drkodi-mac-aarch64.jar
If I take a look at the runnable jar, the library seems to be there, it's also the right arch:
unzip -l drkodi-mac-aarch64.jar | grep javafx
1659 10-25-2019 15:22 BOOT-INF/lib/javafx-weaver-spring-boot-starter-1.3.0.jar
5686 10-25-2019 15:23 BOOT-INF/lib/javafx-weaver-spring-1.3.0.jar
9621 10-25-2019 15:23 BOOT-INF/lib/javafx-weaver-core-1.3.0.jar
3918 10-25-2019 15:24 BOOT-INF/lib/javafx-weaver-spring-boot-autoconfigure-1.3.0.jar
302 10-17-2022 11:07 BOOT-INF/lib/javafx-fxml-19.jar
129499 09-12-2022 11:46 BOOT-INF/lib/javafx-fxml-19-mac-aarch64.jar
306 10-17-2022 11:07 BOOT-INF/lib/javafx-controls-19.jar
2547893 09-12-2022 11:46 BOOT-INF/lib/javafx-controls-19-mac-aarch64.jar
306 10-17-2022 11:07 BOOT-INF/lib/javafx-graphics-19.jar
4812958 09-12-2022 11:46 BOOT-INF/lib/javafx-graphics-19-mac-aarch64.jar
302 10-17-2022 11:07 BOOT-INF/lib/javafx-base-19.jar
752442 09-12-2022 11:36 BOOT-INF/lib/javafx-base-19-mac-aarch64.jar
This is strange to me, since the bundled JRE was created from my local Java installation, it should be the same.
The JavaFX libs are inside the runnable jar, the app is not modular, so it is a little strange that it works one way but not the other.
I am on a Mac M1.
Modules known to my installed JRE:
java --list-modules
java.base#18.0.1
java.compiler#18.0.1
java.datatransfer#18.0.1
java.desktop#18.0.1
java.instrument#18.0.1
java.logging#18.0.1
java.management#18.0.1
java.management.rmi#18.0.1
java.naming#18.0.1
java.net.http#18.0.1
java.prefs#18.0.1
java.rmi#18.0.1
java.scripting#18.0.1
java.se#18.0.1
java.security.jgss#18.0.1
java.security.sasl#18.0.1
java.smartcardio#18.0.1
java.sql#18.0.1
java.sql.rowset#18.0.1
java.transaction.xa#18.0.1
java.xml#18.0.1
java.xml.crypto#18.0.1
jdk.accessibility#18.0.1
jdk.attach#18.0.1
jdk.charsets#18.0.1
jdk.compiler#18.0.1
jdk.crypto.cryptoki#18.0.1
jdk.crypto.ec#18.0.1
jdk.dynalink#18.0.1
jdk.editpad#18.0.1
jdk.hotspot.agent#18.0.1
jdk.httpserver#18.0.1
jdk.incubator.foreign#18.0.1
jdk.incubator.vector#18.0.1
jdk.internal.ed#18.0.1
jdk.internal.jvmstat#18.0.1
jdk.internal.le#18.0.1
jdk.internal.opt#18.0.1
jdk.internal.vm.ci#18.0.1
jdk.internal.vm.compiler#18.0.1
jdk.internal.vm.compiler.management#18.0.1
jdk.jartool#18.0.1
jdk.javadoc#18.0.1
jdk.jcmd#18.0.1
jdk.jconsole#18.0.1
jdk.jdeps#18.0.1
jdk.jdi#18.0.1
jdk.jdwp.agent#18.0.1
jdk.jfr#18.0.1
jdk.jlink#18.0.1
jdk.jpackage#18.0.1
jdk.jshell#18.0.1
jdk.jsobject#18.0.1
jdk.jstatd#18.0.1
jdk.localedata#18.0.1
jdk.management#18.0.1
jdk.management.agent#18.0.1
jdk.management.jfr#18.0.1
jdk.naming.dns#18.0.1
jdk.naming.rmi#18.0.1
jdk.net#18.0.1
jdk.nio.mapmode#18.0.1
jdk.random#18.0.1
jdk.sctp#18.0.1
jdk.security.auth#18.0.1
jdk.security.jgss#18.0.1
jdk.unsupported#18.0.1
jdk.unsupported.desktop#18.0.1
jdk.xml.dom#18.0.1
jdk.zipfs#18.0.1
Modules known to the bundled JRE:
DrKodi.app/Contents/PlugIns/jre/Contents/Home/bin/java --list-modules
java.base#18.0.1
java.datatransfer#18.0.1
java.desktop#18.0.1
java.logging#18.0.1
java.prefs#18.0.1
java.scripting#18.0.1
java.xml#18.0.1
jdk.unsupported#18.0.1
The App uses javafx-weaver, so it is basically a Desktop Spring Boot application.
Today, i want open R on linux:
$R
bash: R: command not found...
and then I remember I installed R using dnf:
$dnf list|grep R-core
Repository libnvidia-container is listed more than once in the configuration
Repository libnvidia-container-experimental is listed more than once in the configuration
R-core.x86_64 4.1.3-1.el8 tuna
R-core-devel.x86_64 4.1.3-1.el8 tuna
It looks like I installed R, so I'm trying to find the location of R:
$which R
/usr/bin/which: no R in (/home/data/sym/software/metawrap/bin/:/home/data/sym/software/ncbi-blast-2.12.0+/bin/:/usr/bin:/home/data/sym/software/FastQC:/usr/condabin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/root/software:/home/data/sym//.aspera/connect/bin/)
I think I may have accidentally deleted some files of R, which made R unable to run, so I tried to reinstall R, and met error, I tried to solve error, and met more error:
$dnf install R
Repository libnvidia-container is listed more than once in the configuration
Repository libnvidia-container-experimental is listed more than once in the configuration
Last metadata expiration check: 1:59:20 ago on Wed 17 Aug 2022 04:09:30 PM CST.
Error:
Problem: package R-4.1.3-1.el8.x86_64 requires R-devel = 4.1.3-1.el8, but none of the providers can be installed
- package R-devel-4.1.3-1.el8.x86_64 requires R-core-devel = 4.1.3-1.el8, but none of the providers can be installed
- conflicting requests
- nothing provides openblas-devel needed by R-core-devel-4.1.3-1.el8.x86_64
- nothing provides tcl-devel needed by R-core-devel-4.1.3-1.el8.x86_64
- nothing provides texinfo-tex needed by R-core-devel-4.1.3-1.el8.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
$ dnf install R --skip-broken
Repository libnvidia-container is listed more than once in the configuration
Repository libnvidia-container-experimental is listed more than once in the configuration
Last metadata expiration check: 2:04:58 ago on Wed 17 Aug 2022 04:09:30 PM CST.
Dependencies resolved.
Nothing to do.
Complete!
$dnf install -y epel-release
Repository libnvidia-container is listed more than once in the configuration
Repository libnvidia-container-experimental is listed more than once in the configuration
Last metadata expiration check: 2:02:01 ago on Wed 17 Aug 2022 04:09:30 PM CST.
Package epel-release-8-16.el8.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!
$ dnf install openblas-devel
Repository libnvidia-container is listed more than once in the configuration
Repository libnvidia-container-experimental is listed more than once in the configuration
Last metadata expiration check: 2:01:16 ago on Wed 17 Aug 2022 04:09:30 PM CST.
No match for argument: openblas-devel
Error: Unable to find a match: openblas-devel
$ dnf config-manager --set-enabled PowerTools
Repository libnvidia-container is listed more than once in the configuration
Repository libnvidia-container-experimental is listed more than once in the configuration
Error: No matching repo to modify: PowerTools.
$ dnf grouplist
Repository libnvidia-container is listed more than once in the configuration
Repository libnvidia-container-experimental is listed more than once in the configuration
Last metadata expiration check: 2:06:29 ago on Wed 17 Aug 2022 04:09:30 PM CST.
Available Environment Groups:
Server
Workstation
KDE Plasma Workspaces
Virtualization Host
Installed Environment Groups:
Server with GUI
Installed Groups:
Container Management
Development Tools
Headless Management
Available Groups:
Fedora Packager
Xfce
.NET Core Development
Graphical Administration Tools
Network Servers
RPM Development Tools
Scientific Support
Security Tools
Smart Card Support
System Tools
$ dnf repolist
Repository libnvidia-container is listed more than once in the configuration
Repository libnvidia-container-experimental is listed more than once in the configuration
repo id repo name
1 1
2 2
3 3
4 4
5 5
docker docker
elrepo ELRepo.org Community Enterprise Linux Repository - el8
libnvidia-container libnvidia-container
libnvidia-container-experimental libnvidia-container-experimental
mo mo
nvidia-container-runtime nvidia-container-runtime
tuna tuna
And i tried to install all the missing dependencies:
$dnf install openblas
Last metadata expiration check: 3:21:34 ago on Wed 17 Aug 2022 04:09:30 PM CST.
Error:
Problem: cannot install the best candidate for the job
- nothing provides libgfortran.so.5()(64bit) needed by openblas-0.3.15-3.el8.x86_64
- nothing provides libgfortran.so.5(GFORTRAN_8)(64bit) needed by openblas-0.3.15-3.el8.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
$dnf search libgfortran
Last metadata expiration check: 3:25:22 ago on Wed 17 Aug 2022 04:09:30 PM CST.
============================================================ Name Matched: libgfortran ========================================
compat-libgfortran-48.i686 : Compatibility Fortran runtime library version 4.8.5
compat-libgfortran-48.x86_64 : Compatibility Fortran runtime library version 4.8.5
$dnf install compat-libgfortran-48.x86_64
Last metadata expiration check: 3:26:34 ago on Wed 17 Aug 2022 04:09:30 PM CST.
Error:
Problem: conflicting requests
- nothing provides libquadmath.so.0()(64bit) needed by compat-libgfortran-48-4.8.5-36.1.el8.x86_64
- nothing provides libquadmath.so.0(QUADMATH_1.0)(64bit) needed by compat-libgfortran-48-4.8.5-36.1.el8.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
$dnf search libquadmath
Last metadata expiration check: 3:29:24 ago on Wed 17 Aug 2022 04:09:30 PM CST.
============================================================ Name Matched: libquadmath ========================================
gcc-toolset-10-libquadmath-devel.i686 : GCC 10 __float128 support
gcc-toolset-10-libquadmath-devel.x86_64 : GCC 10 __float128 support
gcc-toolset-11-libquadmath-devel.i686 : GCC 11 __float128 support
gcc-toolset-11-libquadmath-devel.x86_64 : GCC 11 __float128 support
gcc-toolset-9-libquadmath-devel.i686 : GCC 9 __float128 support
gcc-toolset-9-libquadmath-devel.x86_64 : GCC 9 __float128 support
libquadmath-devel.i686 : GCC __float128 support
libquadmath-devel.x86_64 : GCC __float128 support
So, what exactly is the problem?
The controlsfx JavaFX library has a demo program and some controls fail to run, such as List Selection View, or List Action View or BreadCrumbBar.
I re-tested this on a new Windows 10 PC, with JDK11 and Gradle 5.5 freshly installed. I downloaded the branch 9 .zip, verified that the module-info.java files are present, and entered
gradlew run
For the above mentioned examples, the console shows:
Exception in thread "JavaFX Application Thread" java.lang.NoClassDefFoundError: Could not initialize class org.controlsfx.glyphfont.FontAwesome
at org.controlsfx.samples/org.controlsfx.samples.HelloListActionView.createActions(HelloListActionView.java:144)
at org.controlsfx.samples/org.controlsfx.samples.HelloListActionView.getPanel(HelloListActionView.java:63)
at org.controlsfx.fxsampler/fxsampler.SampleBase.buildSample(SampleBase.java:77)
at org.controlsfx.fxsampler/fxsampler.FXSampler.buildSampleTabContent(FXSampler.java:397)
at org.controlsfx.fxsampler/fxsampler.FXSampler.updateTab(FXSampler.java:305)
at org.controlsfx.fxsampler/fxsampler.FXSampler.changeSample(FXSampler.java:296)
at org.controlsfx.fxsampler/fxsampler.FXSampler.lambda$start$1(FXSampler.java:159)
JAVA_HOME is C:\Program Files\Java\jdk-11.0.3
gradle --version
------------------------------------------------------------
Gradle 5.5
------------------------------------------------------------
Build time: 2019-06-28 17:36:05 UTC
Revision: 83820928f3ada1a3a1dbd9a6c0d47eb3f199378f
Kotlin: 1.3.31
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.14 compiled on March 12 2019
JVM: 11.0.3 (Oracle Corporation 11.0.3+12-LTS)
OS: Windows 10 10.0 amd64
I'd like to take advantage of FontAwesome as well as the above mentioned controls.
I experimented with
JDK 11, 11.0.1, 11.0.2, 11.0.2
Gradle 5.2, 5.5
Command line
IntelliJ
Another PC I usually develop on
ControlsFX has a large number of external dependencies which are handled in the build.gradle file.
If your project does not use gradle to build the library, but instead it imports a .jar of it, then you should add all those options to the VM. To do that in IntelliJ, go to Edit Configuration, there you can find a VM options field.
You can try to copy and paste these options:
--add-exports=javafx.graphics/com.sun.javafx.scene=org.controlsfx.controls --add-exports=javafx.graphics/com.sun.javafx.scene.traversal=org.controlsfx.controls --add-exports=javafx.graphics/com.sun.javafx.css=org.controlsfx.controls --add-exports=javafx.controls/com.sun.javafx.scene.control.behavior=org.controlsfx.controls --add-exports=javafx.controls/com.sun.javafx.scene.control=org.controlsfx.controls --add-exports=javafx.controls/com.sun.javafx.scene.control.inputmap=org.controlsfx.controls --add-exports=javafx.base/com.sun.javafx.event=org.controlsfx.controls --add-exports=javafx.base/com.sun.javafx.collections=org.controlsfx.controls --add-exports=javafx.base/com.sun.javafx.runtime=org.controlsfx.controls --add-exports=javafx.web/com.sun.webkit=org.controlsfx.controls --add-exports=javafx.graphics/com.sun.javafx.css=org.controlsfx.controls
This worked for me. I was facing the same issue with ControlsFX 11.0, while using ListSelectionView.
I am trying to compile a project containing some Java 8 source files using lambdas using SBT 0.13.7.
Now, I set
-java-home /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Home
in
/usr/local/etc/sbtopts
And apparently SBT does take this into consideration, because if I supply the wrong path it complains about no java being present.
However, when I try compiling, I get the following
[error] /Users/edafinov/GitRepos/Java8SBTTest/src/main/java/Main.java:10: error: illegal start of expression
[error] new ArrayList<Integer>().stream().filter(i -> i%2 ==0).count();
[error] ^
[error] 1 error
[error] (compile:compile) javac returned nonzero exit code
[error] Total time: 1 s, completed Dec 26, 2014 12:28:55 PM
This seems to indicate that SBT does not use javac 1.8, but rather the 1.7 one which is the default one for my system.
What am I doing wrong?
Thank you in advance
Apparently if you have a JDK in the path, SBT would try to use that one, even when you have explicitly set the -java-home option. I solved my problem by removing the default JDK from $PATH
On a CentOS 5 server, I have downloaded and unzipped Aptana Studio 3. When I run it, the IDE opens properly but generates an error and ask to close.
The error is the following:
!SESSION 2011-10-13 16:25:43.255 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_25
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Command-line arguments: -os linux -ws gtk -arch x86
!ENTRY org.eclipse.ui 4 4 2011-10-13 16:25:46.561
!MESSAGE Unable to find Action Set: com.aptana.editor.php.presentation
!ENTRY org.eclipse.ui 4 4 2011-10-13 16:26:19.394
!MESSAGE An internal error has occurred.
!STACK 0
org.eclipse.swt.SWTError: No more handlesNative code library failed to load. (java.lang.UnsatisfiedLinkError: /usr/local/Aptana_Studio_3/plugins/com.aptana.swt.webkitbrowser.linux.x86_1.0.0.1295409059/os/linux/x86/libcefjni.so: /lib/libc.so.6: version `GLIBC_2.7' not found (required by /usr/local/Aptana_Studio_3/plugins/com.aptana.swt.webkitbrowser.linux.x86_1.0.0.1295409059/os/linux/x86/libcefjni.so))
and here is the answer to rpm -qi glibc:
Name : glibc Relocations: (not relocatable)
Version : 2.5 Vendor: CentOS
Release : 65 Build Date: Fri 12 Aug 2011 01:49:31 PM EDT
Install Date: Wed 14 Sep 2011 01:31:47 AM EDT Build Host: builder10.centos.org
Group : System Environment/Libraries Source RPM: glibc-2.5-65.src.rpm
Size : 12971036 License: LGPL
Signature : DSA/SHA1, Fri 12 Aug 2011 05:24:55 PM EDT, Key ID a8a447dce8562897
Summary : The GNU libc libraries.
Any way to work around that?
Thanks.
I just removed that plugin (com.aptana.swt.webkitbrowser.linux.x86_1.0.0.1295409059) from the plugins directory. The aptana studio startup web page doesn't work, but I haven't had a problem with regular editing yet.