Latest Posts »
Latest Comments »
Popular Posts »

Netbeans – running programs the easy way

Written by Toomas Römer on March 31, 2009 – 3:10 pm

I have not been so angry at an IDE for a while, arrrrrrrghhh, rant follows.

How hard can it be to add JVM arguments to the run configuration of an application when running it from an IDE? Lets say I want to add -Dsuperboost=true or just ~/myconf/.myconf to the Java application?

Eclipse has a green button and Run configurations under it, there you can specify Program arguments and VM arguments. Easy.

IntelliJ Idea has a green button and Edit Configurations under it, there you can specify Program parameters and VM parameters. Easy.

Netbeans has a green button. Thats it. Where are the options? When you check project Properties there is Build » Compiling & Packaging but no run. Googling for such a generic topic does not help me much, just aggrevates more.

Finally I realize, everything is ANT based, I’ll just modify the build.xml files used. The toplevel build.xml includes project/nbproject/build-impl.xml, this includes some NetBeans bundled build.xml. Okay, this is not the best place.

I find a file named project.properties with two options in it, javac.compilerargs and javac.source. Jackpot, I’ve found the hidden settings, I just need to figure out the magic names that I could add. Some more googling and trying out different flags from different NetBeans versions I’m still out of luck, I’m unable to guess the names.

Finally I went through NetBeans/harness/build.xml » common.xml » run.xml and the magic secret hidden flags follow:

  • run.jdkhome
  • run.args.common
  • run.args.prepared
  • run.args
  • run.args.extra

Weeehah! Now I need only to add “-noverify”. No, more like “-J-Xverify:none”, argghh.


Tags:
Posted in rant | 9 Comments »

It is possible to run Chrome under Linux

Written by Toomas Römer on March 24, 2009 – 7:01 pm

Although very unstable and not that functional there exist Ubuntu packages (they work under Debian also) for Google Chrome (named chromium-browser though), see https://launchpad.net/~chromium-daily/+archive/ppa


Tags:
Posted in cool | No Comments »

Where did my OOM go?

Written by Ivo Mägi on March 24, 2009 – 1:54 pm

Editor: We have a guest appearance from a CDO of a Fortune 500 company (actually not Fortune 500, but yes, a development manager for 200 devs). The twist? He has a compiler installed and apparently an editor too.

The other day I was playing around with a tool for memory analysis and wrote a small snippet using which I would be able to test the new tool. Quickly (Editor: yeah right quickly) created the following and executed it:

[code language='java']
import java.util.*;
class Leak {
static List list = new ArrayList();
public static void main(String[] args) {
for (int i = 0; i >= 0 ;) {
list.add(i++);
}
System.out.println("I will either reach here or die trying (with OOM)");
}
}
[/code]

And what do you think I was displayed by my command prompt (editor: CDOs don't have a command prompt):

Option A:
[code language='java']Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2760)
at java.util.Arrays.copyOf(Arrays.java:2734)
at java.util.ArrayList.ensureCapacity(ArrayList.java:167)
at java.util.ArrayList.add(ArrayList.java:351)
at Leak.main(Leak.java:6)
[/code]
Option B:

CODE:
  1. I will either reach here or die trying (with OOM)

Well, as I found out, it doesn’t print out anything. As this is now two years from my last real Java development experience (got demoted to C-level), I went to my hardcore Java hackers. For 10 minutes we all stood with bedazzled faces, before it struck – the memory will be allocated in a way that there is no room for new OutOfMemoryError() to be created.

If you execute the above with 64MB heapsize (which is the default heapsize):

CODE:
  1. C:\work\snippets\leak java -Xmx64m Leak
  2. C:\work\snippets\leak

But if you increase (well actually modify) the heap size a bit:

CODE:
  1. C:\work\snippets\leak java -Xmx65m Leak
  2. Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
  3.         at java.util.Arrays.copyOf(Arrays.java:2760)
  4.         at java.util.Arrays.copyOf(Arrays.java:2734)
  5.         at java.util.ArrayList.ensureCapacity(ArrayList.java:167)
  6.         at java.util.ArrayList.add(ArrayList.java:351)
  7.         at Leak.main(Leak.java:6)
  8. C:\work\snippets\leak

Moral of the story? I definitely would not want to be fixing a production system dying like this (Editor: lucky you, you don't have to) – most likely I would be mad way before I could have grasped anything about the reasons …


Tags: , ,
Posted in cool, creative, humour | 2 Comments »

When “Do no evil” becomes “Hear no evil”

Written by Toomas Römer on March 18, 2009 – 4:06 pm

After 4 cancellation requests, 2 forum requests, 1 billing support request and 2 months of waiting I’m posting this blog post to let out some steam and hopefully one day get my money back. A story of what happens when the same company offers the service and the payment but no support.

It all started out as a cool infrastructure task. Migrating email to Google Apps. Its easy, quick and on top of that there is a 30 day FREE trial. Wow!

I started with the task in the beginning of January. I created an account at Google Apps, paid for the number of users and was off. 10 minutes later I noticed that I should have used a shorter URL for the domain, so I thought I’ll ditch the mail prefix from the domain.

FAQ says I have to create a new account. Bummer. I created a new account, paid for the number of users again, twiddled with settings and email was working! Easy. I told you so! All I had to do now was cancel the premium service for the longer domain version and I would be all done.

From this point on things got hairy. Firstly as I had tons of tabs open in my browser, I managed to cancel the premium service for the shorter domain. Ok, happens. I’ll just upgrade later on again. Then I cancelled the long URL. Two premium accounts downgraded, one deleted and other running in free edition now.

Of course Google Checkout can’t follow this kind of stuff in real time and I had been charged for both of the services. I contacted the seller from Google Checkout and sent them a message to make my fiddling clear.

Nothing happened. A week later as the funds were still charged I contacted them again via Google Checkout. No luck.

Maybe I’ll have to wait the 30 day for it to be paid back because the free period was also 30 days? Sure thing. Waited couple of more weeks, nothing changed.

Things are getting scary. There is no support if you don’t have a premium account and I’ve just cancelled my two premiums. It seems that the only way to get them talking to me is pay them money, but they already owe me money!

I write to their support forum, twice! Not a single answer during the months. Okay, this is weird already.

I’m able to find a link, that says that one can ask for real support if the question is concerned with billing. Weeehaah, I’m sure I’m saved now! Nope. I made my case using their web form and you know what? No answer!

Usually I would take a step back and talk to the payment mediator, either PayPal or Moneybookers but you know what, Google is handling my payment also (via Google Checkout) and I can’t find a way to report to Google that Google stole my money.


Tags:
Posted in rant | 4 Comments »

Caricature: JavaRebel winning the JOLT Productivity Award

Written by Jevgeni Kabanov on March 17, 2009 – 6:26 pm

jolt_eng

Thanks to Risto for making it. I’m the dude on the left :) Oh, and download JavaRebel!


Posted in meme | No Comments »