Archive for the ‘netbeans’ Category

Disable splash screen on your Netbeans Application

Wednesday, November 19th, 2008

Just add

run.args.extra=–nosplash

to the project.properties file

Attach source code to a Netbeans Library Wrapper Module

Friday, February 22nd, 2008

I´m new in NetBeans and today I´ve been struggling a couple of hours with the simple task of attaching the source code for an external JAR (NetBean Library Wrapper Module).

nb_add_library_wrapper.png

I´ve been trying to find in google how to do it without success until I reached this post in the netbeans-users mailing list.

Then I realized that I should been looking into the NetBeans Help first. The entry at Help -> Help contents -> Java Applications -> Debugging Applications -> Attaching Source Code to a JAR File explains how to do it.

first go to Tools->Libraries to open the Library Manager. Then click on New Library. Give it a name and select the jar. But you should be careful when adding the Library, though. You must point to the JAR file INSIDE your module library wrapper (that´s <module library wrapper folder>/release/modules/ext/) NOT to the original location of the JAR. (As pointed out in the Help -> Help contents -> Netbeans Modules -> Getting started -> Module and Rich-Client Application Tasks: Quick Reference -> Attach source code to libraries for debugging.)

nb_library_manager.png

Then you should add the library´s source folder in the Source tab of the Library in the Library Manager (you can point to the Javadoc as well).

Netbeans Paint Application

Thursday, February 21st, 2008

My first try with the Netbeans Paint Application tutorial didn´t work as expected. For some reasong I got this stack trace when I tried to run it:

java.lang.IllegalStateException: Module was supposed to be OK: StandardModule:org.netbeans.modules.projectuiapi jarFile: C:\Program Files\NetBeans 6.0\ide8\modules\org-netbeans-modules-projectuiapi.jar
       at org.netbeans.ModuleManager.maybeAddToEnableList(ModuleManager.java:1087)
       at org.netbeans.ModuleManager.maybeAddToEnableList(ModuleManager.java:1104)
       at org.netbeans.ModuleManager.maybeAddToEnableList(ModuleManager.java:1104)
       at org.netbeans.ModuleManager.simulateEnable(ModuleManager.java:1048)
       at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:379)
       at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:341)
       at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:275)
       at org.netbeans.core.startup.Main.getModuleSystem(Main.java:171)
       at org.netbeans.core.startup.Main.start(Main.java:322)
[catch] at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:110)
       at java.lang.Thread.run(Thread.java:619)

I managed to solve it although I don´t really know the cause.

  1. Download netbeans-6.0.1-200801291616-ml-platform.zip
  2. Unpack it in c:\netbeans (so there´s a c:\netbeans\platform7)
  3. Go to Tools -> Netbeans Platforms
  4. Click on Add platform
  5. Select c:\netbeans
  6. Finish
  7. Right click on PaintApp project and select Properties
  8. On the Libraries tab. Change the Netbeans Plaform to Netbeans Platform Dev (Build 200801291616)
  9. Select all modules but Core UI and Platform
  10. Rebuild and run

Looking for NotifyDescriptor

Thursday, February 14th, 2008

I´m following the Netbeans Platform Porting tutorial and the NotifyDescriptor was not been recognized by the IDE. I found out that you must add the Dialogs API to the Libraries. Just right-click Libraries and then select “Add module dependency”. In the “Add Module Dependency” dialog just type NotifyDescriptor on the “Filter” field and it automatically select the Dialog API for you.

addmoduledependency.png

Adding Netbeans API source navigation to your Netbeans IDE

Thursday, February 14th, 2008

It took a while to find this entry describing how to include the Netbeans APIs source code. In short, you have to download the actual sources (the link in Geertjan’s Weblog is outdated) at http://download.netbeans.org/netbeans/6.0/final/zip/ (file netbeans-*-platform-src.zip) and then link that zip file to the platform in the platform manager. Make sure that the path doesn´t contains whitespaces (it didn´t work for me).

To access the Netbeans Platform Manager just do Tools -> Netbeans Platforms

netbeansplatformmenu.png

And then click on the Sources tab and “Add Zip/Folder”

netbeansplatformsource.png

The process is documented in the Netbeans help at Help > Help Contents > Netbeans modules > Using the Netbeans api > Extending Skeleton API Implementation > Registering the NetBeans Sources and Javadoc.

Netbeans 6.0 Ruby output not working properly ($stdout is not flushed on program termination)

Monday, March 19th, 2007

After struggling with Netbeans 6.0 Ruby a little bit I finally found why my puts statement are not working properly. It’s due to the following reported bug.(Vote for this bug!!) Also noted in the RubyTodo page from Netbeans wiki.

This problem appears when using native ruby with netbeans instead of jruby.

My workaround is using log4r instead for print statements.

UPDATE: It has been fixed in the latest version of the ruby module. I had to download the prebuilt ruby cluster from http://deadlock.nbextras.org/hudson/job/ruby/ and install it using the following instructions because the ruby module version found in the update center was not fresh enough but today I checked again and version 0.39 is available from the Update Center as well.