Tuesday, 29 January 2008

Netbeans Missing New Project Categories

Jump to solution. (Skip stupid story.)

It was raining outside and it was a dark and said day and there was nothing to work on when I decided to give a try to Netbeans in J2EE development. If you have read my blog before you must know I am an Ubuntu user. Actually not a fan. I am not loving anything easily. But I am in general very satisfied with Ubuntu. I like it very much. Am I a fan? Together with its problem too. But from time to time I am running into problems which can make life harder than .... than is should be. (Life is hard anyway. It does not matter if you are Linux Windows or Mac OS user. So hold on your arguments about it. :) )

Back to the point I have Ubuntu Gutsy which currently contains Netbeans 5.5. So I started it and wanted to start a new project. What a surprise I have seen I could not. There were no menu items besides import existing ant project what I could reach. Holy s.... something! What is this? I was asking.
Tried to purge package and reinstall but no luck. So finally I concluded that the problem is around Netbeans 5.5. What can people do than? I have taken the lattes version Netbeans 6.0 and tried. Much more surprise I had the same situation. No menu to create new project. I started to think about some kind of global conspiracy and decided to unveil it so the day just turned darker.

So first started to Google around. It almost always helps. And I found ideas to delete the ~/.netbeans directory and restart IDE. It did not help me too much. Also find some idea to use different java version. Which also did not help me.
What helped me was deleting ~/.netbeans AND using a Sun java version together. Even java 6 or 5 from Sun. (Anyway you can specify the java version as a netbeans command line parameter like: $ netbeans --jdkome /usr/lib/jvm/java-6-sun )
So I would have sat back and enjoy it. But I wanted to know what was wrong. So first checked that the java version which prevented me to use netbeans was icedtea-java-7. The other thing I had to realize - and primarily made me to investigate it - was that if you ever started netbeans with icedtea-java-7 you can not start it after even with the sun java without deleting ~/.netbeans . This is very uncomfortable since you can loose your settings I decided to find out what was the problem. I do not think that you are interested how I did it but here is the result and how to correct it without loosing your settings.

$ rm -rf ~/.netbeans/6.0/config/Modules

Simple right?
If you are missing New Project Templates in Netbeans and you have started netbeans ever with IcedTea Java 7 - or any other "unsupported one" - first use only SUN Java as long as this error is not corrected to run netbeans. I do not know if this is an error in Iced Tea Java or in Netbeans and do not care too much anymore. To correct the problem completely delete ~/.netbeans/6.0/config/Modules and restart Netbenas with a Sun Java. This directory will be recreated and you can enjoy the newly available menus without loosing your settings.

Hope it helped you too.

Sunday, 6 January 2008

FlightGear Keyboard Shortcut Reference

I just wanted to have a list of keys can be used in FlightGear but found only the short Reference.
I realized that key shortcuts is an xml file so easy to change and not good to publish a static one on the net while anybody can change it anytime easily. So here is a command to get it under linux anytime on your own machine.

First please change directory to the one contains keyboard.xml. Gutsy have it under /usr/share/games/FlightGear

$ awk 'BEGIN {name="";desc="";spec="";} \
/.*<\/name>/{ name=$0; spec="";desc="";} \
/.*<\/desc>/ { desc=$0 ; line=spec " " name " = " desc; print gensub("<[^>]*>([^<>]*)<\/[^>]*>","\\1","g",gensub("\ \ +","\ ","g", line)) ;} \
/<mod-.*>/ { spec=gensub("<mod-(.*)>","\\1 + ","g",$0); } \
' keyboard.xml

Output is something like:
Ctrl-A = Toggle autopilot altitude lock.
Ctrl-B = Toggle speedbrake.
Ctrl-C = Toggle clickable panel hotspots
Ctrl-G = Toggle autopilot glide slope lock.
Ctrl-H = Toggle autopilot heading lock.
Ctrl-I = Show instrument setting dialog.

Than format print, learn and enjoy the game. :)