I had encountered a blog on Troll’s website (can not recall where exactly it was, and who posted it… if you find it, please notify me) about creating Java objects from C++. More precisely, creating Qt Jambi widgets and using them in a C++ program.
There still are no Java bindings for Plasma, but that doesn’t mean that there can not be Java Plasmoids. If you think that I’m talking gibberish, just look at the following screenshot. As you can see, there are a couple of plasmoids that say Java (to be exact, there are 4 of them).
No, they are not C++ plasmoids that just write ‘Java’ to fool you, those are applets written in Java. You have the code in Plasma’s playground (/trunk/playground/base/plasma/applets/java).
The main problem is setting up the environment.
- First you have to install Java SDK (tested with SUN’s, it should also work with IcedTea),
- then, you have to install (or compile) Qt Jambi which is a bit pain in the neck if you have Qt with debug symbols included.
- And, once it is all installed, you need to set the environment variables both for compiling the applet, and running it in Plasma afterwards. You can use the environment.sh that is included with the source, and modify it to your needs. You also need to change the Jambi’s path in CMakeLists.txt.
Well, that should be all. When I find the time to try to generate Plasma bindings for Java, you will be notified :) (To be honest, I hope that someone will beat me to it)