Is it possible to run a java UI (AWT/Swing) application on a Raspberry Pi 2 running OSMC.
I don't know if OSMC runs on top of an X11 layer, or is compatible with the Java UI (AWT/Swing).
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.
Sign up to join this communityThe short answer is yes, but it requires installing some packages, and have an X-Windows Server running.
Assuming you already have Putty installed, open an SSH connection to your Raspberry Pi running OSMC via Putty (user: osmc pass: osmc [unless you changed it]), then execute the following commands:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install openssl
sudo apt-get install xterm
sudo apt-get install xauth
sudo apt-get install libxtst6
sudo reboot
This will close the putty session. Right click on the top left of the putty window, and choose New Session. Enter the IP address for your Raspberry Pi, then on the left hand side of the PuTTY Configuration window, expand Connection, then SSH, then single click on X11, then check the "Enable X11 forwarding" box. Single click the Session option on the left, then enter a name for this session then save it, but don't open it yet.
For an X-Windows Server I used Xming
On the Windows machine you'll need to install:
All of these can be downloaded from the Xming website.
Once you have Xming installed (don't select the "Open Xming" option during the last step of the install process), you'll need to create a launch configuration. This is done with the application: Xlaunch.exe
, which is a wizard that will walk you through the creation of a configuration file.
I chose:
To start the X-windows server, just double-click on on the file you just saved, config.xlaunch
If you receive errors about an x-server already running (if you choose the start option during install), you may need to start task-manager and close all the X-Server processes.
Now back in the PuTTY client, load the configuration you saved earlier, then connect to your Raspberry Pi. Once connected execute:
xterm
This should open an X-Window on your Windows desktop, which is actually the GUI for the terminal application that is actually being executed on your Raspberry Pi.
This should also work for any java applications that require a GUI.