When trying to run a JavaFX app from Raspberry Pi B+ device running Raspbian the UI does not show up unlike when running from a PC.
The command invoked was:
java -jar app.jar
What could be the problem that the UI does not show up?
The solution is to run with this command:
sudo java -Djavafx.platform=eglfb -cp /opt/jdk1.8.0_111/jre/lib/jfxswt.jar:app.jar com.app.MainApp
After doing something similar to this:
Download
http://download.oracle.com/otn-pub/java/jdk/8u73-b02/jdk-8u73-linux-arm32-vfp-hflt.gz
sudo tar zxvf jdk-8u73-linux-arm32-vfp-hflt.gz -C /opt ->installs in
/opt
sudo update-alternatives --install /usr/bin/javac javac
/opt/jdk1.8.0_73/bin/javac 1
sudo update-alternatives --install /usr/bin/java java
/opt/jdk1.8.0_73/bin/java 1
sudo update-alternatives --config javac
sudo update-alternatives --config java
download
http://108.61.191.178/downloads/openjfx-8u40-sdk-overlay-linux-armv6hf.zip
sudo unzip openjfx-8u40-sdk-overlay-linux-armv6hf.zip -d
/opt/jdk1.8.0_73
I guess the user, who is executing the program, has no reading access on the css files. According to that the GUI can't be loaded.
Related
Attempting to make a Minecraft server with my Rasberry pi and I the error above when running the command java -version. I have reinstalled java and the same occurs. I have a raspberry pie 3 B+.
Any help would be appreciated thanks
Per the instructions posted by pi4j https://pi4j.com/documentation/java-installation/
Luckily there are different suppliers providing ready-made packages of
the JDK for multiple platforms. But only Azul seems to have one which
is a perfect fit for Raspberry Pi’s with an ARMv6
So you'd need first to check your board version:
$ cat /proc/cpuinfo
If it has ARMv6 then you need to substitute your Java
$ cd /usr/lib/jvm
$ sudo wget https://cdn.azul.com/zulu-embedded/bin/zulu11.41.75-ca-jdk11.0.8-linux_aarch32hf.tar.gz
$ sudo tar -xzvf zulu11.41.75-ca-jdk11.0.8-linux_aarch32hf.tar.gz
$ sudo rm zulu11.41.75-ca-jdk11.0.8-linux_aarch32hf.tar.gz
Now update alternatives
$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/zulu11.41.75-ca-jdk11.0.8-linux_aarch32hf/bin/java 1
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/zulu11.41.75-ca-jdk11.0.8-linux_aarch32hf/bin/javac 1
Then select the newly installed one
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javac
And here you go, check your new version
$ java -version
I'm using Ubuntu 16.04 64-bit. I installed Oracle JDK jdk1.8.0_144 in /usr/local/java and set the symlinks as below.
$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.8.0_144/jre/bin/java" 1
$ sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.8.0_144/bin/javac" 1
$ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jdk1.8.0_144/jre/bin/javaws" 1
$ sudo update-alternatives --set java /usr/local/java/jdk1.8.0_144/jre/bin/java
$ sudo update-alternatives --set javac /usr/local/java/jdk1.8.0_144/bin/javac
$ sudo update-alternatives --set javaws /usr/local/java/jdk1.8.0_144/jre/bin/javaws
After that, I followed the installation guide in the WSO2 documentation and set JAVA_HOME as below.
nano /.bashrc
added the variable:
export JAVA_HOME=/usr/local/java/jdk1.8.0_144
export PATH=${JAVA_HOME}/bin:${PATH}
I close the old terminals and open a new one and run:
echo $JAVA_HOME
and I get
/usr/local/java/jdk1.8.0_144
However, when I run sh wso2server.sh I get the error:
JAVA_HOME is not defined correctly.
CARBON cannot execute java
error.
You should try to add the following into your .bash_profile
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=$JAVA_HOME/jre/bin:$PATH
There is similar issue: Ubuntu: JAVA_HOME is not defined correctly
There are many other causes of this issue:
1) You are running the server as the super user (sudo) which is not required. However I think you dont have the JAVA_HOME set in super user environment.
2) You can try: sudo JAVA_HOME=/usr/lib/jvm/java-7-oracle ./wso2server.sh
3) You should probably be setting JAVA_HOME to /usr/lib/jvm/jdk1.7.0/jre rather than /usr/lib/jvm/jdk1.7.0.
4) Your version of Identity Server does not support java 8.
replace your java home path in wso2server.sh line no 52
#JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home
JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
I try to install java8 on my Linux server centOS. In /etc/profile
export JAVA_HOME=/root/jdk1.8.0_71/
export PATH=$JAVA_HOME/bin/:$PATH
[root#localhost ~]# echo $JAVA_HOME
/root/jdk1.8.0_71/
[root#localhost ~]# which java
/root/jdk1.8.0_71/bin/java
[root#localhost ~]#
And then I install Cassandra, but it cannot find the java8. And I execute some commands and get
[root#localhost ~]# su cassandra -c "echo $JAVA_HOME"
/root/jdk1.8.0_71/
[root#localhost ~]# su cassandra -c "whereis java"
java: /usr/bin/java /etc/java /usr/lib/java /usr/local/bin/java /usr/share/java /usr/share/man/man1/java.1.gz
[root#localhost ~]# su cassandra -c "which java"
which: no java in (/root/jdk1.8.0_71//bin/:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
I want to know since the PATH is right, why I failed to get java using which java?
And then I create soft link and change the mode of /root/jdk1.8.0_71 to 777
cd /usr/bin
java -> /root/jdk1.8.0_71/bin/java
But it is still not work. Did I miss somethings or make anything wrong?
If the user Cassandra does not have permission on the /root folder then it wont be able to find it. I don't know why would you copy the JDK in the /root folder. My suggestion is to copy the jdk1.8.0_71 in the /opt folder and set the correct permission (owner or group), something like:
cp -r /root/jdk1.8.0_71 /opt
chown -R cassandra.cassandra /opt
Additional, setting paths in the PATH variable should not include the trailing to avoid "/root/jdk1.8.0_71//bin/"
I installed Java and when I executed jps
its throwing
jps: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
The Commands I executed to configure is
sudo mkdir -p /usr/lib/jvm
sudo cp -R jdk1.6.0_45 /usr/lib/jvm/
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_45/bin/javac 1
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_45/bin/java 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_45/bin/javaws 1
sudo update-alternatives --config javac
sudo update-alternatives --config java
sudo update-alternatives --config javaws
The above issue is due to missing command
sudo ./jdk-6u45-linux-x64.bin
Then copy command should be there.
I am trying to install jdk for 32-bit OS. Followed the below steps,
wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" http://download.oracle.com/otn-pub/java/jdk/6u38-b05/jdk-6u38-linux-i586.bin
chmod u+x jdk-6u34-linux-i586.bin
./jdk-6u34-linux-i586.bin
mkdir -p /usr/lib/jvm /usr/bin/java /usr/bin/javac /usr/bin/javaws
mv jdk1.6.0_3./usr/lib/jvm/`
update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_38/bin/java" 1
update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_38/bin/javac" 1
update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jre1.6.0_38/bin/javaws" 1
but while running cmd 6 i am getting below error. Any help would be appreciated.
update-alternatives: warning: forcing reinstallation of alternative /usr/lib/jvm/jdk1.6.0_38/bin/java because link group java is broken.
update-alternatives: warning: not replacing /usr/bin/java with a link.
update-alternatives: warning: forcing reinstallation of alternative /usr/lib/jvm/jdk1.6.0_38/bin/javac because link group javac is broken.
update-alternatives: warning: not replacing /usr/bin/javac with a link.
update-alternatives: error: alternative path /usr/lib/jvm/jre1.6.0_38/bin/javaws doesn't exist.
if you need to install java in Ubuntu, you can try using following command and you will get oracle-java-installer in your synaptic package manager, click it and install it.
sudo add-apt-repository ppa:webupd8team/java
Else try following steps
$ wget http://download.oracle.com/otn-pub/java/jdk/6u34-b04/jre-6u34-linux-i586.bin
$ chmod u+x jre-6u34-linux-i586.bin
$ ./jre-6u34-linux-i586.bin
$ sudo mkdir -p /usr/lib/jvm
$ sudo mv jre1.6.0_34 /usr/lib/jvm/
$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jre1.6.0_34/bin/java" 1
$ sudo update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "/usr/lib/jvm/jre1.6.0_34/lib/i386/libnpjp2.so" 1
$ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jre1.6.0_34/bin/javaws" 1
The issue is that you have created a folder named "java" in /usr/bin . Remove the folder from /usr/bin and run the command again.
Instead of Step 4 :
4. mkdir -p /usr/lib/jvm /usr/bin/java /usr/bin/javac /usr/bin/javaws
Just use
$mkdir -p /usr/lib/jvm
and make sure that you are moving the files to usr/lib/jvm , for that use
$mv -v jre1.6.0_34 /usr/lib/jvm/
so that you can see the details and after installation change the configuration of java and javaws by :
$update-alternatives --config java
select from the option
similarly ,
$update-alternatives --config javaws
this should work if you have already another java installed
Remove folder java from /usr/bin and try again