Java in Plasma
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.
It gave me an idea. How about a Java-based Plasmoid? We have Python, JavaScript (ECMAScript) and what not, but no Java.
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)
Cheerio!









That would make a nicer icon for kde3’s kaffeine movie player!
Comment by Dread Knight — June 5, 2008 @ 8:07 pm
That is Java icon from Oxygen…
Comment by admin — June 5, 2008 @ 8:11 pm
Cool! Very cool,
I will try this out for sure but after my exams
I’m very interested in java bindings for plasma/kde! So I hope that they are coming soon.
I would want to help with them. I should have time for this in July (I don’t have any experience with generating java bindings for c++ though, but I can learn that)
Comment by Thomas Coopman — June 5, 2008 @ 8:38 pm
Java would be nice, but I bet Groovy would be even nicer.
Comment by jrick — June 5, 2008 @ 9:15 pm
Well, Qt Jambi comes with binding generator. Unfortunately, it is not /that/ straightforward and I have no time to play with it at the moment. (due to same reasons as you
@JRick
If something can generate a .class file, it can be loaded via JNI so… Groovy on…
Comment by admin — June 5, 2008 @ 9:25 pm