Categorie: Eclipse

IntelliJ – The IDE I wanted to love

27 June 2009

In the Java market we have a plethora of ide’s to choose from. The one I am most familiar with and also see used most often is Eclipse. Everyone knows Eclipse of course. Eclipse is not without its faults. So its natural to look around every so often. Eclipse is my baseline. At this point we arrive at IntelliJ. IntelliJ is another well known ide. I have heard IntelliJ described as the only ide for java developers, the ide that wil increase productivity 10-100 times. Its a commercial product which means you can have a reasonable expectation of stability, customer support and all the nifty tooling you would expect in Eclipse or any other ide. Naturally you expect it to be better than Eclipse or you would’t pay for it. I proceeded to download, install and put IntelliJ to use.

A few words on environment. I run Debian Lenny on a Dell Precision T-3400.

IntelliJ is an easy install. Download, unpack, run (,????, profit!). Its only 100MB compressed which is less than 150MB for Eclipse classic (and a lot less than 650MB for MyEclipse). You may need to check JDK_HOME variables but I’m guessing most people wil have this set up already. Otherwise what are you doing with a Java specific IDE. You may be confronted with a dialog or two. To begin with you should be safe with the defaults. Odds are you only need a subset of the defaults to begin with anyway.

My first impression after the install is that IntelliJ is very pretty. Especially after I changed the theme. This all went really well. Everything was fast and seemed well thought out. Of course IntelliJ has its own key mapping, menu ordering and things of that nature. If you like you can enable Eclipse key mappings but if you want to get to know a program rather than get to work quickly I recommend going with what’s totally unfamiliar. Although I am of the opinion that ctrl-s means save in any language.

The Subversion plugin works like a charm. I am even convinced it’s faster than Subversive…at least in our local environment where Subversion has, at times, been a pain to work with. If for no other reason, this plugin makes me want to use IntelliJ. If my work confined itself to talking to the repository I would be done. Forever.

So here we have a fresh working copy of our project, complete with Eclipse project files. IntelliJ understands Eclipse project files or at least so it claims. An import or two later and I have an official IntelliJ project. As far as I’m concerned I just need to point this puppy to Tomcat and we’re good to go.

Now IntelliJ has a lot of spiffy UI thingies. You got screens for configuring everything. You’ve got modules and facets. You’ve got raindrops on roses and warm woolen mittens. Confidently I configured the project to deploy to tomcat. Of course it wouldn’t work at once, that would be too much to ask. I was convinced any problems I was sure to encounter would be easy to solve.

My first problem comes in the form of compiler errors. “But wait,” you say, “did you not do a fresh checkout? Are your colleagues so daft that they enter broken code?” That would be yes and not usually. IntelliJ seems less permisive than eclipse in allowing certain constructs. Mind you Eclipse has no compile errors on the same code…so it can’t really be a compiler error since they use the same one. Ok, so its a precompile syntax validation check error or whatever. It’s not really a big deal.

Unfortunately I have no clue what IntelliJ is really doing. Somewhere there exists a tomcat. Somewhere there exists at least one copy of this tomcat. Somewhere you may or may not be deploying your project. Ok, I can actually find where IntelliJ hides its tomcat copy. Why can’t it just use my tomcat? I don’t know. Oh you can, sort of, but then you all of a sudden have to start and stop tomcat yourself. Not that I really care that IntelliJ uses a copy of tomcat, except that this copy still uses the originals directories. Sort of. I think. I’m not really sure.

A word on IntelliJ support. If you happen to write them they answer quickly. Really quickly. Actually the reply is there almost before you press compose mail. I was seriously impressed. Unfortunately they couldn’t help me and I dind’t want to rely heavily on support which is mostly meant for paying customers anyway. I also don’t like using support lines in general. It feels like a flaw in the product. Which it is.

You may be asking why I didn’t simply look up the answers in the documentation. IntelliJ documentation is one of the worst I have ever seen. It’s not worse than factually wrong information but it’s not better than a blank piece of paper. Basically if you have something labeled “Perform action” the documentation wil read “Performs the action Action”. The documentation will never actually explain what is happening or go into the details of anything.

So now I have a project which may or may not be deploying somewhere. After some looking around I do figure out I have lots of classpath problems. Also, my ant builds aren’t being run. Ok, add library here, ant build before deploy…Some progress made but not enough. My project still won’t work.

To make a long story short for about a week I’ve been playing with IntelliJ. I’ve installed, reinstalled, checked out, imported, etc, etc. I can’t get our project to work. This is a project which does work under Eclipse. So I blame IntelliJ. Where Eclipse always seems to have the thing you are looking for where you are looking for it, IntelliJ will make you search for it. Where Eclipse forces you to know what you’re doing and setup this and do that, IntelliJ has done it for you (mostly) and otherwise you can pretty much forget it.

To me IntelliJ is like a beautiful woman with a really anoying personality and a deaf ear. I really wanted to like it. Ask my colleagues, I am ready and willing to say that I hate something. I do it regularly and with passion. I do it to Eclipse all the time. Yet, despite all this, I really can’t hate IntelliJ. I would still really like to work with it. I’m convinced it could be really good. I can’t hate it and yet I can’t love it. For now it wil remain the IDE I wanted to love.

Ubuntu and Eclipse: The error was ‘BadAlloc (insufficient resources for operation)’.

19 January 2008

Linux and Eclipse have proved themselves as a killer combination for Java (EE) development. Specially for technology savvy users, which i guess a lot of programmers are, the combination is a dream come true.

Though once in a while things can heat up under the hood.

With the uprise of Ubuntu, meant as a very user friendly version of Debian, many developers are trusting in their Ubuntu/Java/Eclipse environment and with good reason. It installs very easily, runs very fast and provides features like update-notifications, very fast turn around times for security updates and an almost insane amount of hard and software support.

Though the common Linux distributions (may i even say OpenSource) practice of fast turn around on security updates is a very good thing to have. It can once in a while turn into an unpleasant experience. Like today 18 Januari 2008.

To fix a programming error in the Xorg graphical software component of Linux the Ubuntu people pushed out an update for it called xserver-xorg-core_1.3.0.0.dfsg-12ubuntu8.1. I applied this update in the early morning when working at home and when i had to leave to continue working at the office i shutdown my laptop and went to the office as usual.

Only to find out that my laptop was not working as expected when booting up. The login manager appeared (GDM) and i logged in, finding my desktop (Gnome) in a half broken state. Firing up Eclipse was even worse, throwing me the following ‘unclear’ error message on the console:

The program ‘Eclipse’ received an X Window System error.
This probably reflects a bug in the program.
The error was ‘BadAlloc (insufficient resources for operation)’.
(Details: serial 1086 error_code 11 request_code 147 minor_code 5)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the –sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)

Error Message

Now the obvious solution is to reinstall the package version before the security update or wait for the next update.

You can download the old version of the package from the following location: http://security.ubuntu.com/ubuntu/pool/main/x/xorg-server/xserver-xorg-core_1.3.0.0.dfsg-12ubuntu8_i386.deb

Install this package with the following command

$ dpkg -i xserver-xorg-core_1.3.0.0.dfsg-12ubuntu8_i386.deb

Now restart your X server by loggin out of your desktop and back in again or restarting your server and you should be fine again.

At the time of writing, which is about half a day after the update hit the Ubuntu servers and i first found myself dealing with this problem, the Ubuntu people are pushing out there second update for the broken xserver-xorg-core package called: xserver-xorg-core_1.3.0.0.dfsg-12ubuntu8.2

You can safely install this new version and have everything working as expected.

Summary:

Old good version:

xserver-xorg-core_1.3.0.0.dfsg-12ubuntu8

Broken updated version:

xserver-xorg-core_1.3.0.0.dfsg-12ubuntu8.1

New good version:

xserver-xorg-core_1.3.0.0.dfsg-12ubuntu8.2

If you want to be safe, wait until tomorrow (19/20 Januari 2008) before you hit the update button, make sure that you updated your apt repository and verify that it’s installing the 8.2 update version of xserver-xorg-core. Then you should be all set to keep your desktop up to date and running like a charm :)

Last but not least, the official advisory for this bug:

Debian Security Advisory DSA-1466-2
Package : xorg-server, libxfont, xfree86
CVE Id(s) : CVE-2007-5760 CVE-2007-5958 CVE-2007-6427 CVE-2007-6428 CVE-2007-6429 CVE-2008-0006

The X.org fix for CVE-2007-6429 introduced a regression in the MIT-SHM
extension, which prevented the start of a few applications. This update
fixes this problem and also references the patch for CVE-2008-0006,
which was included in the previous update, but not mentioned in the
advisory text.

Ing. Bas van Oostveen

M4N

Post-Scriptum: currently Ubuntu has released even a third patch to xserver-xorg xserver-xorg-core_1.3.0.0.dfsg-12ubuntu8.3

Eclipse en Mac OS X

23 January 2007

Afgelopen week heb ik getracht Eclipse aan de gang te krijgen op Mac OS X. Uiteindelijk draait het wel, maar er waren de nodige hobbels op de weg. We gebruiken trouwens SVN. De eerste stappen gingen gemakkelijk genoeg:

  • downloaden Eclipse voor Mac
  • downloaden MyEclipse plugin
  • aanpassen memory settings
  • Tomcat eraan hangen
  • aanmelden op de svn (met username/wwoord) en checkout

Vervolgens probeerde ik een simpele aanpassing te doen in een stukje sourcecode. Deze comitten – error. Nog eens proberen – error! Hmmm – misschien toch iets foutgegaan tijdens installatie. De hele procedure opnieuw gedaan. Weer die error tijdens comitten. Damn..

Vervolgens nog eens opnieuw, maar dan met de Subclipse plugin van Polarion in plaats van de MyEclipse plugin. Ik had het vage vermoeden dat die MyEcplise het op de 1 of andere manier niet goed doet op de Mac. Zou nergens op slaan, aangezien het Java is, maar goed. Weer vage errors tijdens comitten: NullPointerException
Vervolgens met mijn useraccount op een werkend Ecplise installatie op Linux geprobeerd – ook een error. Gelukkig – het ligt dus waarschijnlijk aan de serverkant.
Het issue bleek te zijn dat ik wel leesrechten op het filesystem had van de svn server, maar geen schrijfrechten. Blijkbaar gaat het op een vrij laag nivo fout en kan Eclipse de error niet opvangen en doorgeven. Errug jammer van de verspilde tijd, maar wel weer een goede les geleerd.

best counter