Javafx program GUI not correctly display in raspbian - javafx

I've used this command to execute sudo /opt/jdk8/bin/java -jar axulfxx.jar the program. It is working but the problem is the GUI of program is not correctly display just like a TV that has a poor signal.
I've done lots of solutions but still no luck.

Anyways I solve my own problem by add DISPLAY=:0 after /opt/jdk8/bin/java -Djavafx.platform=gtk2 -jar axulfxx.jar.

Related

How to run qt-creator project with 'sudo nice x' prefixes?

So i have a C program that i made a while back that im going to remake in qt with additional features.
Typically how i ran the program is I open the terminal, navigate to the project folder, and use the command
$ sudo nice --10 ./myprogram
That is not the case anymore, since i am using qt-creator i now just simply click the 'run' button and the program starts. My program works best when it has elevated scheduler priority hence the nice --10.
How do i modify my qt-creator project to run my program with the sudo nice --10 command?
To do that go to
Tools-> Options-> Environment -> System Tab under the terminal option write "/usr/bin/xterm sudo nice --10"
Also if you have not done it already go to Projects -> Build & Run -> Run and check the box Run in terminal.
I never tried, but in the config of your project you can add a user defined executable to be executed.
Maybe creator allows for a shellscript, than you can simply put your sudo nice --10 in a shellscript, or you write a little program which gets a program path as parameter and starts it with the elevated scheduler priority (guess there is a user api in linux for that...)

QmlProfiler : Plugin initialization failed: Cannot create OpenGL context

I use Qt 6.2.2 in ubuntu 20.04 and I install OpenGL like this:
sudo apt install libgl1-mesa-dev
After I install my graphics card driver (NVDI 470.86) I get this error each time I open QtCreator IDE.
why did this happen and how can I fix this?
I cant compile examples that use qt quick like Qt Quick 3D - Custom Materials Example
QML debugging is enabled. Only use this in a safe environment.
qt.quick3d.general: Unable to find ideal GL version. QGLXContext:
Failed to create dummy context QRhiGles2: Failed to create temporary
context QRhiGles2: Failed to create context Failed to create RHI
(backend 2) Failed to initialize graphics backend for OpenGL.
output pictures:
output from glxinfo | egrep -i version
I understand that qt creator save its settings in /home/username/.config/QtProject and It understand OpenGL from there.
So I delete my .config folder and reboot my system and let my OS create it again this Fix my problem but as #merosss said that he change his usermod to the video that was one way because qt creator will create it in that path and problem will fix again.
Since I install the NVIDIA driver it seems that Qt cant understand which OpenGL should use and that problem happens.
Had the same problem since this morning. Not sure why this worked (any contribution is appreciated), but I solved it by adding my user to the video group and rebooting:
sudo usermod -a -G video *username*

Fedora 30: GTK fails to load appmenu-gtk-module

I am learning to program in Python and Rust. On different versions of Ubuntu these programs compiled and ran perfectly. Now that I have a dedicated Fedora 30 KDE system, every time I try and build a program, I get a warning: Failed to load module "appmenu-gtk-module"
I have tried looking this up and have re/installed anything GTK on my system. The programs otherwise function well, but no menus are drawn. I was also trying things in GNOME and hit the same thing.
I am also using QT. Those programs also build and run fine, but again, no menu.
I'm going bonkers with this. Any help is appreciated.
The appmenu-gtk module is not packaged on Fedora. (GNOME doesn't support them anyway.)
The real questions are:
Why is it configured to load? Did you copy or share GTK config files from an Ubuntu system? You should remove this module from your settings.
Even with improper configs I don't believe this should result in menus not appearing. It should just fail to load and work as normal. How is your application using menus?
I finally got so fed up with getting this error that I went full nerd-diagnosis, and ran this command to find out which file contained the errant reference to the appmenu-gtk (the package that would provide this is not installable on my system either).
(Replace "dolphin" with the command that is giving you the error.)
strace -e openat,access dolphin 2>&1 |grep -v ENOENT |awk '/appmenu-gtk/ {exit} !/appmenu-gtk/ {print}'|cut -d '"' -f2 |sort|uniq|xargs grep appmenu-gtk 2>/dev/null
This will then give you a list of files which contain the line appmenu-gtk, and in my case it was ~/.config/gtk-3.0/settings.ini. From there I just commented it out, and that gets rid of the error message (not sure if this will fix your problem of not having any menus, but you might just be able to edit that line to fix it in another way if commenting it out doesn't work).

Qt IDE run error: cannot open .so file but running from terminal it is fine

I wrote a simple code to test CUDA with Qt on Linux Ubuntu.
While running app within Qt IDE I get the following error:
However while running app from command line I don't get any erorr and all computation done by CUDA are correct.
Also while running CUDA samples from command line, everything is okay.
Also all paths in Qt .pro file are set correctly
So the question is why Qt IDE prompts me with above error?
Ok, problem fixed.
Turns out that LD_LIBRARY_PATH does not do its job.
What I did instead was:
add this
/usr/local/cuda-7.0/lib64
to
/etc/ld/so/conf
file
Run
sudo ldconfig
I hope it will help somone

Jar file not executing

I am having a problem, I run my jar file but nothing happens, not even an error, it just returns to the cmd line where I started. the java code is ok because it works fine in netbeans on the machine i created it on, what is missing from the machine I am actually running it on? help please
If you are using javaw(java's "consoleless" version) instead of java and you print the answers with:
System.out.println(String stringToPrint);
or with
System.out.print(String stringToPrint);
You won't have anything printed on the screen because javaw won't print anything, so try execute it like this:
java -jar filename.jar
If this is not what you are looking for, sorry.

Resources