Tag Archives: java

Fixing IntelliJ IDEA font glitch on Ubuntu

This post is mostly for myself to remember what changes to make in IntelliJ IDEA. The problem is that fonts are ugly and not antialized in stock-IDEA. In my case it affects IDEA 13 and 13.1 so far.

The problem is still not completely solved, the fonts are looking better, but still not as good as in Eclipse. Don’t ask me why, I just don’t know.

After googling for a good while I came up with the following additions that improve how fonts are rendered:

In idea64.vmoptions add the following lines:

-Dawt.useSystemAAFontSettings=on
-Dswing.aatext=true
-Dsun.java2d.xrender=true

At the very end of idea.sh exchange the following line

eval "$JDK/bin/java" $ALL_JVM_ARGS -Djb.restart.code=88 $MAIN_CLASS_NAME "$@"

for

eval "/usr/lib/jvm/jdk-7-oracle-x64/bin/java" $ALL_JVM_ARGS -Djb.restart.code=88 $MAIN_CLASS_NAME "$@"

This is to make sure that Oracles JDK is used as there seems to be a problem with OpenJDK and fonts in IDEA (even though this works in Eclipse). Make sure you use the path that is correct for your JDK.

While at it I also increased the default memory settings and my complete idea64.vmoptions looks like this now:

-server
-Xms256m
-Xmx2048m
-XX:MaxPermSize=512m
-XX:ReservedCodeCacheSize=256m
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+UseCodeCacheFlushing
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-Dawt.useSystemAAFontSettings=on
-Dswing.aatext=true
-Dsun.java2d.xrender=true

New release of Java 1.5

Sun released Java 1.5.0_17 today. This release fixes (among other things) the regression bug of Java 1.5.0_16 which made it impossible to view and edit metadata in Conzilla. I wrote about this in a previous blog post.

Generally I recommend to use Java 1.6, but if you have to use 1.5 for some reason you can get the new version directly from Sun.

Recent problems with launching Conzilla

I got several emails these days from people who were not able to launch Conzilla anymore. The reason was an exception (“java.net.MalformedURLException: no !/ in spec”) during start up.

I investigated the problem (which is caused by a regression bug of Sun’s most recent Java 5.0, i.e. 1.5.0_16) and tried to work around it, but came to the conclusion – as many other developers who tried to solve the very same problem – that it is best to wait for a fix from Sun.

The reason is that it would require too many changes in the code and even some major refactoring. Apart from that, even third-party libraries as e.g. log4j are affected. Conzilla is not the only application which has been broken, basically all applications making use of Java Web Start are affected.

Bugs have been reported to Sun:

http://bugs.sun.com/view_bug.do?bug_id=6746185
http://bugs.sun.com/view_bug.do?bug_id=6753651

Let’s hope that Sun fixes this bug very soon, until then my recommendation is: Do not use JRE/JDK 1.5.0_16, and if you happen to use it, downgrade to an earlier release, or upgrade to 6.0/1.6.

I will keep you informed regarding this issue.

Conzilla 2.2.3 released

This is a maintenance release, fixing the following bugs:

  • “Contexts” context menu was disabled when clicking for the first time
  • Shortcut and menu for closing a tab/context-map did not work
  • “Window”-view could not be closed via X-button in the window frame
  • “Save” button was always enabled
  • HTTP implementation of RemoteStorage did not timeout properly
  • Multithreaded loading of maps caused problems; it is optional now and deactivated it by default
  • Sindice client did not time out
  • Metadata popup sometimes showed up beneath map elements
  • Added menu to manually clear the container and metadata caches
  • Content URLs did not open in a browser on newer MacOS systems

Conzilla 2.2 requires a Java Runtime Environment in version 1.5 or newer and can be installed via the download page. If you already have an installation of Conzilla 2.1 it should be sufficient to launch Conzilla via the shortcuts. Java Web Start will then take care of the upgrade.

If you have comments or suggestions you can send them directly to the Conzilla mailing lists.

Hardy, Java and crashing applications

Following up my problem description in my last post, I tried to get Eclipse (and other crashing Java applications) running with the Java 6 version that is shipped with Hardy.

The changelog of the packages sun-java-* (version 6.06) claims that the locking problems with XCB have been fixed upstream:

* New upstream bug fix release.
  - Release notes at http://java.sun.com/javase/6/webnotes/ReleaseNotes.html.
  - Fixes Xlib/XCB locking problems. LP: #86103. Closes: #414535.

But this is not the case, at least not for me.

Googling the problem showed a few potential workarounds, like

export LIBXCB_ALLOW_SLOPPY_LOCK=true

and

sed -i 's/XINERAMA/FAKEEXTN/g' /usr/lib/jvm/java-6-sun/jre/lib/i386/libawt.so

Neither of them worked. So I’m back with Java 6 from Gutsy, which just works fine on Hardy.

I wonder whether I am the only one with these problems… are they going to release Hardy with a broken Java/XCB combination?

Upgrade to Hardy

I updated to my Ubuntu system to version 8.04 “Hard Heron” RC. It’s a release candidate, so there won’t be many changes until the “real” release in a few days.

The upgrade process itself went through without any problems, but I had to fix a few things which did not work anymore after the upgrade. There was:

  • Applications using GL kept crashing themselves (like fgl_glxgears) or the whole X-server (like Google Earth).

Not good. It turned out that my fglrx installation was somehow broken, Ubuntu even told me that I’m not using any proprietary drivers. So I downloaded the new 8.4 release of fglrx, baked my own debs and installed them.

Nothing crashed, but the applications refused to start because of missing library: libGL.so.1. This might indicate a slightly broken fglrx package creation for Hardy. Anyway, a symbolic link solved the problem.

ln -s /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1
  • Eclipse kept crashing

Eclipse started, and during building the workspace, it always crashed. I tried without plugins, a fresh installation, etc, then I downgraded Java 6 to the version from Gutsy, and everything worked.

It was enough to pull the packages sun-java6-bin, sun-java6-jdk, sun-java6-jre, sun-java6-plugin and sun-java6-source out of the Ubuntu archives and install them. To make Ubuntu’s update notifier stop bugging me about the existing newer packges (which I just downgraded) I set them all on hold via

echo {$packagename} hold | dpkg --set-selections

The problem might be connected to libxcb and libmawt, because instead of a crashing VM I sometimes get the following messages:

Locking assertion failure.  Backtrace:
#0 /usr/lib/libxcb-xlib.so.0 [0xb7d00767]
#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_unlock+0x31) [0xb7d008b1]
#2 /usr/lib/libX11.so.6(_XReply+0xfd) [0x903d91bd]
#3 /usr/lib/jvm/java-6-sun-1.6.0.03/jre/lib/i386/xawt/libmawt.so
...

I remember having had some similar problems in Gutsy (or was it Feisty?). I will look into this when I’ve got some more time.

  • Firefox 3 does not support old add-ons

The default browser in Hardy is Firefox 3 (there is still packages will Firefox 2 if you want to). That’s good and bad. It’s good because it feels more lightweight and JavaScript-heavy sites feel much more responsive. It’s bad because it’s still a Beta (I already experienced a few crashes) and because some popular extensions like del.icio.us Bookmarks are still not compatible with the new version.

To keep it simple, I added the following boolean setting to the configuration (about:config):

extensions.checkCompatibility = false

This will give you a warning inside the Add-ons window, but most of the officially incompatible extensions will work after that.

No other problems with the new version so far. ūüėČ