Category Archives: Programming

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
Advertisements

Green Hackathon at OKFestival in Helsinki

And so it was time again! We are going to run a two-days Green Hackathon at the OKFestival in Helsinki. The conference will last for the whole week with the Green Hackathon happening on September 19 and 20. I will not write so much more in this blog, I link instead to other sites where event information and press releases have been published.

You do not need a ticket for the OKFestival in order to participate in the Green Hackathon, however, you have to sign up at http://lanyrd.com/2012/okfestival-green-hackathon/ to get your name onto the guest list.

See you in Helsinki!

Links

Green Hackathon at OKFestival
Post by OKFN
Post by EIT ICT Labs
Post by CESC

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.

Attachments with SOAP

Just read an article on how to send (binary) attachments with SOAP.

One described approach is to include the data as MIME or Base64 encoded CDATA blocks. Another possibility is to attach the binary data outside the SOAP message (like it is done in emails). Finally the author talks about SOAP Message Transmission Optimization Mechanism (MTOM), which is supposed to fix the problem.

Well, MTOM has to be understood by the server and the client, which means we have to find a proper implementation etc. Why all this hassle? If it is necessary to send such data, it would perhaps make sense to think of using a Resource-Oriented Architecture (ROA) like RESTful Web Services. This doesn’t mean that it is necessary to switch over completely from a SOA to a ROA, but both techniques could complement each other in RPC-heavy systems. In other cases I would try to avoid using SOAP and focus on resources instead.