« srpen 2005 »
PoÚtStČtSoNe
1
2
3
4
5
14
    
       
Today

Navigation

Speaker Profile
Roumen's Weblog
Login
Sun Bloggers
Technorati Profile

Am I popular?

Today's Page Hits: 444

Contacts

Name: Roman Strobl
E-mail: roman dot strobl
at sun dot com

NetBeans

Java Sites

Javalobby
The Server Side
Java Tips
Java Blogs
java.net
java.sun.com
java.cz

Blogs

NetBeans:
Geertjan
Brian Leonard
Gregg Sporar
Lukas Hasik
Ludovic Champenois
Vincent Brabant
Alexis Moussine-Pouchkine
Jullion-Ceccarelli
Tom Ball
Tim Boudreau
Jesse Glick
Petr Blaha
Ruth Kusterer
Jara Uhrik
xzajo
Jan Lahoda
James Branam
nbextras.org

Sun:
Kazem - bug cartoons ;-)
Tor Norbye
Romain Guy
James Gosling
Chief Gaming Officer
Bill Vass
Jim Grisanzio
Jonathan Schwartz

Planets:
Planet Netbeans
Planet Sun
Planet Eclipse

Other:
netbeans-blog.org
Joel Spolsky
Bruce Eckel

License info

Creative Commons License
This work is licensed under a Creative Commons License.

Recent Entries

Map of visits

Locations of visitors to this page
« Previous day (Aug 20, 2005) | Main | Next day (Aug 21, 2005) »
20050821 Neděle srpen 21, 2005
Interesting Essay from Paul Graham

I recommend reading Paul's essay. I agree that meetings can waste a lot of time, blogging can be more effective than traditional marketing, people can do incredible amounts of work if they really like the job, more work is done at home than in the office (although working most of the time at home doesn't work IMO because of communication issues - good luck with that Paul) and being on time in the morning is not important for software people. The last part of the essay gets a bit utopistic, but the rest is a very interesting reading.
Weekend Partying in Prague

Yesterday a friend of mine got merried. She had a party in a pub on the Old Town Square, the famous one with the Orloj clock. It's also a place where well known Czech write Kafka was supposed to live (the funny thing about this is that there are quite a few places in Prague where they claim he lived - probably a good way how to attract tourists :-)

Anyway, the party was fun and we decided to something very stupid. All the boys took their belts from our trousers and we tied the bride by them. We carried her over several bars in Prague, all the tourists were staring at us, it really looked like if we captured her (she was quite loudly complaining about it, too). One of my friends had a problem with his trousers, while we were carrying the bride they were falling down. Which was another attraction for the shocked tourists.

The poor bride had to drink lots of alcohol, we drank chilli vodka and I thought I would scream when I drank it, it tastes... well... like vodka with a lot of chilli. Then we went to another bar where works a friend of us and got for her all kinds of exotic drinks. The funny thing is that for the whole time we did this, the husband didn't care - when we came back he was very calm about the whole thing :-)

We went dancing yesterday, I do not know from where I took the energy because I was dancing on Friday till morning. If you plan to visit Prague, I recommend to taste Prague's nightlife. In some clubs the atmosphere is very... hot... and the drinks are cheap if you come from west. A usual price of beer is less than 1 Euro or $1. Which is the reason why Prague is sometimes called the "fourth price category of Europe", the city center is full of foreigners who come here just to party.
Hacking NetBeans #5 - Boundling a Library with Your Module

Unless you're doing something very standard there is a probability you'll need to include an additional library with your module. At first it's a good idea to take a look if the library is not included with the IDE (in module/ext subdirs of individual clusters). In that case you can just declare dependence on the module which boundles the library and you're done.

However you probably won't be so lucky and you'll need to provide the library yourself. As I was told it's better to provide your library as a single module - this way others can then depend on this module if they need the library. Some useful info about this is here. There is a new wizard in NetBeans Plug-in Modules | Library Wrapper Module Project which can do most of the job for you if you want to create a library wrapper module.

The other possibility is to add the library directly into your module which has an advantage that you provide single a nbm with everything. Create a subdirectory e.g. external and place the jar into it. It's a good idea to change the name of the jar, e.g. from mail.jar into mail-1.3.2.jar so that other people can find out what's its version easily.

In order to get the jar copied into your nbm, you need to add something like this to your build.xml:

    <target name="netbeans-extra" depends="init">
        <mkdir dir="${cluster}/modules/ext"/>
        <copy todir="${cluster}/modules/ext">
            <fileset dir="external">
                <include name="mail-1.3.2.jar"/>
            </fileset>
        </copy>        
    </target>

This way you create a modules/ext subdir in your nbm and copy necessary libraries into it. You may need to get the library on classpath, so that it's visible for other modules. The classpath extensions are specified in project.xml like this:

            <class-path-extension>
                <runtime-relative-path>ext/mail-1.3.2.jar</runtime-relative-path>
                <binary-origin>external/mail-1.3.2.jar</binary-origin>
            </class-path-extension>

To add more jars to classpath just use additional class-path-extension tags. You get the same effect if you add the Class-Path: property into your manifest, but this method is deprecated - use project.xml for this purpose.

You will also need the IDE to recognize the jar, so that you can use code completion, methods called from the library don't get underlined as errors, etc. This is done by adding a property into the project.properties file:

cp.extra=\
    external/library1.jar:\
    external/library2.jar

Similar properties are used for tests - test.unit.cp.extra and test.qa-functional.cp.extra, so if the IDE doesn't recognize the API provided by the library, you're probably missing them.

Note that there are special requirements on libraries hosted on www.netbeans.org, this document explains what needs to be done. The document explains everything necessary about scrambling and unscrambling, how to add a license to the nbm and few other legal topics (legal stuff is boring but you need to be correct).

I've been fighting quite a lot with adding a library to ant's classpath, this is a larger topic so it will deserve another post. Btw, if there's any area about module development you find fuzzy or underdocumented, let me know, I like finding out how things work. I can't guarantee that I will understand everything perfectly, but just writing about how things work for me might help other people out.


    Disclaimer: The contents of my blog represent my personal opinions which may differ from official views of my employer, Sun Microsystems.