A "java" loader script to apply some extra settings

Bug #99435 reported by Marco Trevisan (Treviño)
8
Affects Status Importance Assigned to Milestone
sun-java6 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: sun-java6-bin

This isn't really a bug report, just a place where I can post a script I made to fix some issues with java applications, the most important things imho are:
 - It detects beryl or compiz running and if needed it applies the AWT_TOOLKIT workaround
 - Set the default java style to GTK+ native (java6 supports it, so it should be used!)
 - Read font aliasing KDE settings, and applies to the java apps

The latest two features I think that are much needed by KDE (kubuntu) users (like me) that now can have their java apps look like the rest of the desktop (thanks also to gtk-qt engine) with cool fonts.

This will be surely rejected, but I decided to post it here just to notify people that there's a way to fix some problems with java with few lines of bash...

Script file in next comment ;)

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

"java" Script attached.

To use it you simply should do:
 $ sudo mv /usr/lib/jvm/<your-java-dir>/jre/bin/java /usr/lib/jvm/<your-java-dir>/jre/bin/java-bin
 $ sudo mv java /usr/lib/jvm/<your-java-dir>/jre/bin/java
 $ chmod +x /usr/lib/jvm/<your-java-dir>/jre/bin/java

Now all will work like before but with optimized settings... Use "java -version" to check it ^_^

Also available at: http://paste.ubuntu-nl.org/13114/

Bye...

Changed in sun-java6:
status: Unconfirmed → Rejected
Revision history for this message
robogeek (david-herron-sun) wrote :

It's not necessary to do this shell script.

According to the documentation for javax.swing.UIManager if the file jre/lib/swing.properties exists it is read for properties.

Unfortunately it appears the only way to override the default for awt.toolkit is the method here: http://java.sun.com/javase/6/docs/technotes/guides/awt/1.5/xawt.html

Revision history for this message
robogeek (david-herron-sun) wrote :

I'm surprised MToolkit is still there, I thought it had already been removed. You should be aware it's planned to be removed but since it's there in java6 it'll stay in java6 so it must be java7 where it'll be removed.

We don't have KDE support like there is GTK L&F support. But this could be changed in the source.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Also if this script isn't always needed, I'm still using it and so I've attached here a newer version of the script with some fixes and improvements. It works both with JRE and JDK "java" binaries.

Just a more thing: the MToolkit workaround isn't needed on java versions majaor than JDK6 Update 6u1 build b01, so maybe I should add a control for that. BTW I've not done it yet since it could be just a waste of time when loading a java application.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.