Tuesday Nov 25, 2008

Today, I wanted to build NetBeans from sources. I had no problem with it when building the release65 branch. But I needed to build development branch for next release and I've run into some problems.

 First problem was Apache ant. My /usr/bin/ant is version 1.7.0. I'm not sure, where does this ant come from. Maybe its Apple's Xcode. But ant 1.7.1 is needed to build today's NetBeans sources. I like having my software up-to date without manual re-installation. Thus it's not surprising, that I really like apt-get in Ubuntu or Software Update in Mac OS X. But this /usr/bin/ant probably likes to be out of date. Luckily, I found out, that DarwinPorts is providing ant binaries. Exactly the way I like it, apt-get style.

Sadly, I was far from having complete NetBeans build. Running /opt/local/ant in NetBeans repository's main folder ended like this:

          ...
          [repeat] The system is out of resources.
          [repeat] Consult the following stack trace for details. 
          [repeat] java.lang.OutOfMemoryError: PermGen space
          [repeat]     at java.lang.ClassLoader.defineClass1(Native Method)
          ...

In the release65 times, the ANT_OPTS system variable had to be set properly, when you wanted to see the BUILD SUCCESSFUL message. So I double-checked it and it really was set like:

export ANT_OPTS=-Xmx512m

 Though, I was still getting this unpleasant OutOfMemoryError. I had to do some googling, then I finally found out the solution. Another ant option has to be set:

export ANT_OPTS='-Xmx1024m -XX:MaxPermSize=512m'

The build finally finished successfully after setting the MaxPermSize. I'm not sure about minimal numbers which lead to successful build, I've just enlarged them both.    



Monday Oct 20, 2008

NetBeans 10y logo

Today's post will be short. Join us and celebrate!

Birthday Index - http://www.netbeans.org/birthday/index.html
Decathlon - http://www.netbeans.org/birthday/decathlon.html

Friday Jul 18, 2008

Did you know, that there is a really simple way to set your Java environment in Ubuntu, when you have multiple Java packages installed?

Everything you need is to run update-java-alternatives command with correct parameters.

Just look at your installed Java packages (use ls -l /usr/lib/jvm/ command):

petr@pchytil-ws:~/nbsrc_main/main/mercurial$ ls -a1 /usr/lib/jvm/ 
.
..
java-1.5.0-gcj-4.2-1.5.0.0
java-1.5.0-sun
java-1.5.0-sun-1.5.0.15
.java-1.5.0-sun.jinfo
java-6-sun
java-6-sun-1.6.0.06
.java-6-sun.jinfo
java-gcj
.java-gcj.jinfo

You can see three .jinfo files here. Just take name of this files without extension and you have right parameters for update-java-alternatives command.

On my machine, I have three Java packages installed:

java-1.5.0-sun
java-6-sun
java-gcj

So choose the package you want and run

sudo update-java-alternatives -s <java_name> 

for example i want to use JDK 6.0:

sudo update-java-alternatives -s java-6-sun

This command creates links for all important Java binaries. java -version command should now give you the Java version, which you always dreamed of ;-).

petr@pchytil-ws:~$ java -version
java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode)

Monday Jul 14, 2008

What will be this post about? It is just a short tutorial about how to let NetBeans IDE create for you a simple webpage, which contains the Java applet inserted as JNLP file. 

What will you need?

  • Firefox 3
  • JDK 6u10 plugin
  • NetBeans IDE 6.5 M1 or later

Now, you are only few steps from having your own applet running. So click on Read more and keep reading ;-).

[Read More]

Wednesday Jul 09, 2008

 I have to share my today's work experience with you. I was going to do some testing of one new NetBeans IDE 6.5 features. It is improved support for new Java Web Start features which will come with incoming Java SE 6 update 10. I saw many full-featured applications, which were able to start directly from a web page. And NetBeans IDE has features to help you easily create such application. Just open your project's properties and you're in.

But I'm not going to write about Java Web Start technology. It is nothing new. Today, I was looking for some applet, which uses JNLP to test the next-generation Java Plug-In installation in my Firefox 3. And you now what? I've ended playing Quake 2 inside my browser's window!

Playing with next-generation Java Plug-In on Firefox & Ubuntu

But let's start at the very beginning of the story. I was standing in front of task to install the next-generation Java Plug-In, which comes with Java SE 6 Update 10. I am running Ubuntu 8.04.1 desktop. The installation process of Java Plug-in has changed a little since previous version of the Java Plug-in. So I followed the installation steps and removed any preexisting symlinks to the libjavaplugin_oji.so. But despite of that applets were not working. So I wrote about:plugins into Firefox address bar and found out, that Firefox is still using Java Plug-in from JDK 6 update 6 and not the new libnpjp2.so. I was not able to locate any symlink to libjavaplugin_oji.so on my system, so I had no clue how to get rid of non-existing symlink. Then I realized, that I had installed sun-java6-plugin. Solution was simple:  sudo apt-get remove sun-java6-plugin. That was it. Applets began to work properly.

Next-generation applets

You may know about Jake 2 project. I had no idea, that something like this exists. So you can imagine my surprise, when one of the demo applets on the next-generation Java Plug-In page showed up to be the mentioned Jake 2 project running in web browser as an applet. And the performance was stunning! Just have a look at their benchmarks. Such an applet was far beyond my imagination. My development experience with applets ended on small school project, which simulated behavior of rabbit and wolves populations. Looks like lots of unused potential in this technology, does it?

How to easily create such applet?

Are you bored with demos created by others? So grab NetBeans IDE 6.5 M1 - our latest stabilized development  build at NetBeans download page and try to create your own applet with powerful JNLP technology. I'll write short how-to next time. Just to keep posts reasonable long.

Tuesday Jul 08, 2008

Just few words about me

 It is quite obvious, that my name is Petr Chytil. And this is the place, where I want to keep useful informations, which I am discovering during my work. Did I mention work? Yes, that pretty determines topic of this weblog. I am an employee of Sun Microsystems since 2006 and proud member of NetBeans Core QA team (our shiny new blog). I am still feeling like complete beginner in the huge world of Java Technology. So expect posts like: "Wow NetBeans IDE contains syntax highlighting for Java files, did you know that?"

I am also finishing my MSc. studies at Faculty of Electrical Engineering, which is part of Czech Technical University. My studies and work interconnects my Diploma thesis. It's topic is Statement Tracking in Version Control Systems. I must say, that I feel like a pretty lucky guy having such an opportunity to study topics, which are so close related to my daily work.

This blog copyright 2009 by Petr Chytil