TvQuran

Sunday, December 6, 2009

How to customize NetBeans IDE, Configure Used-Memory and Look And Feel and more in just 2 Minutes

NetBeans Performance sucks and want to give it more resources (Memory...) to perform better?!
Want to Change the Netbeans IDE Look and Feel in just 2 minutes?!
Did you ever un-installed the JDK Accidentally and want to reinstall only the JDK without reinstalling NetBeans IDE?!

Well, We will do all of that and more by editing the start-up parameters with two easy methods, hope to enjoy them.


First Method, Editing the netbeans.conf file:

  • Finding the Configuration File : At every PC with NetBeans Installed, there are two versions of the netbeans.conf file, a global and a local one.
          We can use :
    • The Global : If we want to change the settings for all users using a shared NetBeans installation,  You find it in the NetBeans installation directory:
    • The Local : If we want to make individual changes that will apply only to a specific user, You find  it in the user's userdir . 
    • 1st PS : If you cant find the userdir, you will find more about it here.
    • 2nd PS:The local file does not exist by default! If you don't see a ${userdir}/etc directory you have to create the file yourself. The easiest way to do that is to copy the global netbeans.conf file from the NetBeans installation folder to the local ${userdir}/etc folder, and then make the desired changes. 
  • Edit the netbeans.conf file : We will use the following elements at the netbeans.conf file
    • netbeans_default_options : We may use this for changing the memory configuration, changing Look and Feel, etc.
      • For Example:
      • to change the Look and Feel edit the next parameter
        • --laf LookAndFeelClassName
        • (e.g.)  --laf javax.swing.plaf.metal.MetalLookAndFeel
      • to change the font size edit the next parameter
        • --fontsize size
        • (e.g.)  --fontsize 14
      • to change the initial heap size edit the next parameter
        • -J-Xms sizeInMegaBytes
        • (e.g.)  -J-Xms128m
      • to change the maximum heap size edit the next parameter
        • -J-Xmx sizeInMegaBytes
        • (e.g.)  -J-Xmx384m
    • netbeans_jdkhome : We may use this for changing the location of the JDK which will be used to run NetBeans.
      • For Example:
      • # Default location of JDK, can be overridden by using --jdkhome dir
      • netbeans_jdkhome="C:\Program Files\Java\jdk1.6.0_13"
    • Note that :
      1. The “#” character means that the following line is a comment.
      2. IF the global and the local configurations made a conflict the :
        • The setting in the local file have the priority to be executed over the global one.
        • If you running the  IDE from command line, the command line parameters have the priority to be executed over both the local and the global configurations.

    Second Method, NetBeans Startup Settings Plugin:


    You can use this cool tool created by Claudio Miranda to edit all of this configurations easily.
    • Features :
      • Backup and restore original settings (etc/netbeans.conf).
      • Able to configure and store different JDK and NetBeans user directory.
      • Store settings (jdk and userdir) under JDK Preference API.
      • Support to on-line updates through update center.
      • LGPL license.
      • If specified userdir doesn't exist, a new one will be created.
      • Remember netbeans user and JDK directories, across different NetBeans installations.
    • Requirements :
      • JDK 5 or higher.
      • NetBeans 6.x.
      • A writable $HOME/.java/.userPrefs directory.
    • Setup :
      1. You may do an anonymous checkout, you must have subversion client installed, by invoking :
        svn co --username anonymous --password anon http://svn.javaforge.com/svn/netbeans-modules/trunk/nb-settings nb-settings
      2. Or you may download this nbm file, however this is not recommended.
    • After installing the plugin you can reach to it by going to Tools > Options > Miscellaneous, and here is the screen shot of the plugin.




















    Please feel free to contact us for more information about the post or about installing the NetBeans IDE modules.
    Hope you enjoyed the post of this day and learned a new stuff. Your comment always inspiring us and the main motivator for doing our best, So please leave your comment whatever it was, It always help.


    Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

    8 comments: on "How to customize NetBeans IDE, Configure Used-Memory and Look And Feel and more in just 2 Minutes"

    sameh Ammar said...

    very nice i love netbeans from the last version


    very nice keeponforward man


    thnx i love this blog;

    Islam El-Hosary said...

    Thanks Sameh for your support :)

    MUFIX said...

    Thanks Islam for nice topic
    Go a Head )

    Islam El-Hosary said...

    Thanks Ahmed for your support ... We will do our best to get you the best

    Anonymous said...

    مشكوووووووووووووووووووووووووووووووووووووووووووووووووووووووووووور

    Unknown said...

    Thanks solom , always you come to us by a new topics ... go ahead solom , and enjoy us by this topics thanks

    Islam El-Hosary said...

    You Are Welcome Badbod ... hope to enjoy the topics and wait the coming ;)

    Post a Comment