Saturday, October 6, 2007

run netbeans directly from a jar

To launch NetBeans from a jar is useful when you want to do something different, or, if you hate the native launcher and want to make Java a really cross platform one. Hansmuller has wrote a blog about Using Java Web Start to Launch NetBeans. I tried it but failed to locate the NetBeans homedir, and there seems to be no source attached. So I googled for a while and find this page suggesting how NetBeans start itself. But the most useful information comes from the following article, which is conspicuously, from Sun's site.

Generic Launcher

The $nbplatform cluster is guaranteed to contain $nbplatform/lib/nbexec executable that is supposed to be used by final products. Example:

The NetBeans IDE product should provide its own executable /usr/bin/netbeans which will locate the $nbplatform/lib/nbexec (currently implemented here for unix and here for windows) executable, read their own configuration files, find out locations of additional clusters and pass --clusters /pathto/nb4.0:/pathto/ide4:/pathto/enterprise7 and --userdir $HOME/.myproductuserdir to it.

The Native Product should have its own launcher called netbeans-native and read its own settings, specify its own user directory and list of clusters (probably --clusters /pathto/ide6:/pathto/web9 as the Native product is extension of the base NetBeans IDE without the enterprise part) and pass that information to the generic $nbplatform/lib/nbexec.

Configuring the Launcher

The behaviour of nbexec launcher can be influenced by special arguments and environment variables:
  • --clusters - specifies the paths to clusters that shall be placed on the execution stack (config, modules, configurations, etc.). Individual elements are separated using java.io.File.pathSeparator so for example on Windows it is ; and on Unix :

  • --branding - gives the name of branding that shall be used

  • regular parameters - these are end user oriented parameters printed when invoked with --help option:
    Usage: bin/../platform4/lib/nbexec {options} arguments

    General options:
    --help show this help
    --jdkhome path to Java(TM) 2 SDK, Standard Edition
    -J pass to JVM

    --cp:p prepend to classpath
    --cp:a append to classpath

    Core options:
    --laf use given LookAndFeel class instead of the default
    --fontsize set the base font size of the user interface, in points
    --locale use specified locale
    --userdir use specified directory to store user settings


Now we are assured that NetBeans can and is in deed launched from a jar(or a cluster of jars ^_^), and the .exe thing is just a configuration reader. Look into the nbexec file, and you will finally get the command like this:
java -Djdk.home=/usr/lib/jvm/java-6-sun -classpath $nbhome/platform6/lib/boot.jar:$nbhome/platform6/lib/org-openide-modules.jar:$nbhome/platform6/lib/org-openide-util.jar:$nbhome/platform6/lib/locale/boot_ja.jar:$nbhome/platform6/lib/locale/boot_pt_BR.jar:$nbhome/platform6/lib/locale/boot_zh_CN.jar:$nbhome/platform6/lib/locale/org-openide-modules_ja.jar:$nbhome/platform6/lib/locale/org-openide-modules_pt_BR.jar:$nbhome/platform6/lib/locale/org-openide-modules_zh_CN.jar:$nbhome/platform6/lib/locale/org-openide-util_ja.jar:$nbhome/platform6/lib/locale/org-openide-util_pt_BR.jar:$nbhome/platform6/lib/locale/org-openide-util_zh_CN.jar:$nbhome/platform6/lib/locale/swing-l10n_pt_BR.jar:/usr/lib/jvm/java-6-sun/lib/dt.jar:/usr/lib/jvm/java-6-sun/lib/tools.jar -Dnetbeans.dirs=$nbhome/nb5.5:$nbhome/ide7:$nbhome/enterprise3/ -Dnetbeans.home=$nbhome/platform6 org.netbeans.Main --userdir /home/yang/.netbeans/
BTW, NetBeans can be shared between linux and M$win.

Thursday, September 27, 2007

lazy boy

The lazy boy had a busy day doing something useless.
还是不可避免的要使用中文。今天很忙。早上7点二十多爬起来,上课之后去自习教室。背了一半单词,睡着了。1点半醒来,赶紧去图书馆领勤工俭学的表格,结果巨多人在排队。又去学院六楼网络部迎新,到6点10分。赶去书法课,接着是会计课。九点多种吃的午饭加晚饭。
反正是3个单词都没背,连昨天的一个也不准备复习了。

Wednesday, September 26, 2007

finished List1

还是用中文写吧。
今天背完了第一个word list.
主要是时间没有安排好,早晨起床就是11点了,用了一个小时多背第一个list,然后就去上课。晚上自习的时候想把list2结束掉,但是由于瞌睡,以及没有预料到的图书馆关门会提前关门,没有成功。
计划一下明天的事情,分两次背完3个新的list,早上和中午一次1.5个。晚上的时候吃饭的时候复习早上的,睡前复习中午的和今天的2个。并且,把word list3隔过去,一来可以完全参照杨鹏的方法省去自己制定计划的麻烦;二则前面的list其实是跟TOEFL的list有很大重叠的,以前都背过的。
关键的一点是要早起。

Monday, September 24, 2007

Start my long run on GRE

今天是在看tasiha上的经验,收获最大的是 vprzhs 整理的 『新手必看』网上GRE备考经验小辑。
http://bbs.taisha.org/thread-259110-1-1.html
整个一个压缩包里的word文档都是很精品的文章,看完之后会对GRE有系统的认识。

并且以后要每天都写下在GRE准备过程中的学习感想来。
真正的起点应该是昨天晚上,在12:00之前把红宝书的MP3拖到硬盘上。

当然还要感谢老同学,同桌 一片冰心
http://user.qzone.qq.com/303773043
是她在上周六晚上的一条短信才让我重新记起还有GRE这档子事情,并且在第二天(2007年9月17号)买会了红宝书。
胜利属于我们!

Saturday, June 23, 2007

difference between JiWai.de and Twitter

JiWai.de or Twitter ? API Documentation 1

API Documentation 2

#1 http://groups.google.com/group/twitter-development-talk/web/api-documentation
#2 http://groups.google.com/group/jiwai-development-talk/web/jiwai-deapi *

* to visit #2 http://64.233.179.104/translate_c?hl=en&u=http://groups.google.com/group/jiwai-development-talk/web/jiwai-deapi

Friday, June 22, 2007

free phone

I found this --> https://www.gizmocall.com <-- as I was reading Ella's blog about 100 most useful website. it's a website provide free calls to more than 60 countries including China. You can make 5 minutes free calls each day after register. Thus my Moto received a international call from +0001901211 at 3:08. I didn't answer as there may be a charge for answering a non-local call, but it did work. Also I noticed gizmocall has a Linux client as well, before which I thought Skype the only choice of VoIP under Linux. Tried to google more about VoIP under Linux, and found another IM software/VoIP project tapioca, which was digged as 'Gtalk for Linux'.

Register on twitter.com -->http://twitter.com/bkuyang




Can call me for free at -->Call me for free

Thursday, June 21, 2007

skip exam

today is the date for the English listening and speaking test. but I didn't get up until 4 in the afternoon, it's not because of sleepiness. It's useless to take a test for something you haven't been learning for about 2 months. What's more, the score can be given and modified by yourself.

Last night I got a call from home, which I didn't answered for I thought they were asking for the account number I forgot to send them the day before. then I sent father 2 SMS. One saying I still have enough money if the term is not to be expanded so they don't need to send me more, and the other telling them my account number. As you see, it's a small trick. I was just hinting that they could still send me the money even if it's not necessary. However, I found before the call the money had already been sent, that is, they gave me a ring just to confirm if I had got the money.

I feel sham.