Česky   |  Deutsch   |  English   |  Español   |  Français   |  Indonesia   |  日本語   |  한글   |  Polski   |  Português (BR)   |  Türkçe   |  中文   |  正體中文   |  Your Language  
Planet NetBeans is an aggregation of NetBeans related musings from all over the Blogosphere.
[RSS 1.0 Feed] [RSS 2.0 Feed]
[FOAF Subscriptions] [OPML Subscriptions]
Do you blog about NetBeans ? Add your blog to PlanetNetBeans.
Feed Subscriptions
NetBeans Zone - The social network for developers (feed)
APIDesign - Blogs (feed)
Pandaconstantin (feed)
blogtrader - Blog (feed)
David R. Heffelfinger (feed)
Winston Prakash's Weblog (feed)
Anchialas' Java Blog (feed)
markiewb's blog (feed)
Michael's blog » NetBeans (feed)
ProNetBeans (feed)
Paulo Canedo » NetBeans English (feed)
Need to find a title (feed)
Category: NetBeans | Software and Science (feed)
Roger Searjeant's blog (feed)
Optonline Webmail (feed)
Allan Lykke Christensen » NetBeans (feed)
Inspiration and Expression » Netbeans (feed)
Gualtiero Testa » Netbeans (feed)
James Selvakumar's Blog » netbeans (feed)
John O'Conner » NetBeans (feed)
Koberoi Oracle (feed)
nB gUru » NetBeans (feed)
Newsintegrator Blog » netbeans (feed)
Praxis LIVE » NetBeans (feed)
TechAshram » NetBeans (feed)
There's no place like » Netbeans (feed)
Adam Bien (feed)
Ignacio Sánchez Ginés » NetBeans (feed)
Bernhard's Weblog (feed)
Michel Graciano's Weblog (feed)
Ramon.Ramos (feed)
Ozone and Programming » netbeans (feed)
Tiplite » netbeans (feed)
Arun Gupta, Miles to go ... (feed)
Geertjan's Blog (feed)
.JARa's Bilingual Weblog (feed)
JavaFX Composer (feed)
The Java Jungle (feed)
Jesse Glick (feed)
Martin Grebac (feed)
The NetBeans Community Podcast (feed)
NetBeans Profiler (feed)
NetBeans for PHP (feed)
NetBeans Web Client (feed)
Rechtacek's (feed)
Virtual Steve (feed)
My First Blog - Satyajit Tripathi (feed)
The Aquarium (feed)
Tinuola Awopetu (feed)
Insert Witty Irony Here (feed)
mkleint (feed)
Anuradha (feed)
Netbeans6/6.5 my best practices (feed)
Java Evangelist John Yeary's Blog (feed)
Neil's Dev Stuff (feed)
Computer says null; (feed)
NetBeans Adventures, Java and more (feed)
Bistro! 2.0 (feed)
NetBeans Community Docs Blog (feed)
The Netbeans Experience (feed)
NbPython/ jpydbg / pymvs (feed)
Wade Chandler's Programming Blog (feed)
Big Al's Blog (feed)
Code Snakes (feed)
In perfect (spherical) shape (feed)
Van Couvering Is Not a Verb (feed)
Diego Torres Milano's blog (feed)
Vroom Framework (feed)
Messages from mrhaki (feed)
Jeff's Blog (feed)
Manikantan's Netbeans (feed)
Oliver Wahlen's Blog (feed)
Shuttle between Galaxies (feed)
Shanbag's Blog (ರಜತ ಲೋಕ) (feed)
Welcome to my live... (feed)
Netbeans IDE Blog by Tushar Joshi, Nagpur (feed)
Devel Blog (feed)
diamond-powder (feed)
Antonio's blog (feed)
Where's my Blog?!

Powered by:    Planet

Last updated:
October 25, 2014 02:06 PM
All times are UTC

Sponsored by
sponsored by Oracle

visit NetBeans website
Geertjan's Blog - October 25, 2014 11:39 AM
YouTube: Finger Tracking on the NetBeans Platform

Synertial released this awesome motion capture video yesterday, showing among other things NetBeans Platform based IGS-Bio in action!

<span id="XinhaEditingPostion"></span> </p>

An earlier blog entry by me on this software is found here.

Adam Bien - October 25, 2014 04:42 AM
Enterprise Nashorn with Java 8 at JavaOne 2014

<br />

See also other screencasts at: http://tv.adam-bien.com or subscribe to http://www.youtube.com/user/bienadam.

See you at Java EE Workshops at Munich Airport or on demand and in a location very near you: airhacks.io!

Real World Java EE Workshops [Airport Munich]>

NetBeans Zone - The social network for developers - October 24, 2014 03:00 PM
Java, IoT, and NetBeans IDE in Australia

A few months ago, the Java 8 World Tour reached Australia, with Java evangelist Angela Caicedo visiting several JUGs and other organizations, such as the  Australian Institute of Marine Science, to demonstrate the latest Java features. Preview Text:  A few months ago, the Java 8 World Tour reached Australia, with Java evangelist Angela Caicedo...

Geertjan's Blog - October 24, 2014 07:38 AM
Awesome Review for "NetBeans Platform for Beginners"

I noticed that there's yet another awesome review of "NetBeans Platform for Beginners" on its feedback page, by Peter Hansson:

I've just finished a vacation where I took "NetBeans Platform for Beginners" with me in Kindle format. I've previously read Heiko's book, I've written a NB platform app or two and I still found your book full of insight that I wish I've had earlier on. Where a lot of the other books and online tutorials fail is in explaining WHY a certain feature of the platform looks the way it does. What was the intent from the API author? What can it be used for? What is the benefit? This is the area where I think your book excels. I also like your clear no-nonsense language.

Skipping over a display problem on Kindle, which the authors can't be blamed for and I'm sure they're working to resolve, how does the book compare to the other established books in this area?

I was hesitant at first to buy the book. I already had Heiko's book (in hardcopy) and the title of Walter and Jason's book threw me off a little (the word "beginner"). The book for me has been worth every penny and I'm looking forward to other NB related stuff from the authors. I've used Heiko's book a lot and I would still recommend it but I would say that if you only have money for one book then it should be "NetBeans Platform for Beginners". No doubt!

Want to create serious applications on the Java desktop too and need an awesome book, with great examples, and lots of explanations, to get you started? Here it is:


Tip: Buy the book together with "Exercises in Porting to the NetBeans Platform", which recently had a great new addition added to it, exercise 3, which shows a pretty thorough porting scenario with a real application as its starting point.


Adam Bien - October 24, 2014 04:03 AM
JAX-RS: Returning A List Of Instances, Problem and Solution

Wrapping a list of instances with a Response:

    public Response workshops() {
        List<Workshop> workshops = ...//a list of entities
        return Response.ok(workshops).build();

Leads to a type loss carried by the Collection and the following (or similar) exception:

MessageBodyWriter not found for media type=application/json, type=class java.util.Arrays$ArrayList, 
genericType=class java.util.Arrays$ArrayList

JAX-RS comes with GenericEntity which carries the generic type. You only have to wrap the Collection with the GenericEntity to solve the problem:

import javax.ws.rs.core.GenericEntity;
    public Response workshops() {
        List<Workshop> workshops = ...//a list of entities
        GenericEntity<List<Workshop>> l
        ist = new GenericEntity<List<Workshop>>(workshops) {
        return Response.ok(list).build();

See you at Java EE Workshops at Munich Airport, particularly at: Effective Java EE 7!

Real World Java EE Workshops [Airport Munich]>

Geertjan's Blog - October 23, 2014 01:34 PM
Editor Tools for CSS in NetBeans IDE (Part 2)

Continuing from yesterday, the NetBeans features helping you with CSS include some more hidden goodies. Look in the Editor tab, in the Hints section, and you'll see that within your HTML files, helpful suggestions are available for CSS references:

By default, the hints that are shown are not shown as errors. I prefer them to be errors, so configured them as such in the Options window tab shown above, which means that when I reference a class that has not been defined in my CSS files, I get a very clear notification that there's a problem:

When I press Alt-Enter in the above situation (or click the yellow lightbulb in the left sidebar), the available CSS stylesheets are shown and I can choose in which of them a skeleton CSS rule should be generated, which I can then fill out with details.

Adam Bien - October 23, 2014 05:27 AM
Rethinking Packaging, Modularization, Interfaces with Plain Java EE 7: 33rd Degree Conference

See also other screencasts at: http://tv.adam-bien.com or subscribe to http://www.youtube.com/user/bienadam.

See you at Java EE Workshops at MUC Airport, particularly at the Java EE Architectures workshop!

Real World Java EE Workshops [Airport Munich]>

Geertjan's Blog - October 22, 2014 08:26 PM
Editor Tools for CSS in NetBeans IDE (Part 1)

When you're inside a CSS file in NetBeans IDE, press Alt-Insert, and then you can call up this dialog, to insert new CSS rules into the CSS file:

When OK is clicked above, the skeleton of a new CSS rule is inserted into the CSS file.

Next, when you're using your CSS rules, such as below, there are some cool things you can do.

Firstly, press Alt-F7 above, i.e., while you've selected the name of a rule that you've defined, and then a search of all usages is done, same as is done in Java source files and other kinds of files, with the same kind of result:

And then you can click on the items above to jump to the file and the line where they're defined. The above is totally different to a text search, for example, if I have "menu" somewhere in the comments, which is more than likely, that instance of "menu" will not be found  since it is not a usage of the "menu" class.

Secondly, when you press Ctrl-R, while the "menu" class above is selected in an HTML file, you call up the in-place rename dialog, just like you would do in a Java source file. Then you can rename "menu", which will also rename all occurrences of "menu", e.g., in the CSS file where that rule is defined.

Adam Bien - October 22, 2014 12:33 AM
CLI, Docker and Lambdas: Nashorn ...and Java EE

Java 8 comes with fast JavaScript engine called "Nashorn". At this JavaDay 2014 session I'm presenting examples and ideas for using Nashorn in enterprise applications with less code and more flexibility. Command line automation, docker monitoring and bi-directional Java integration:

I wondered during this session, why the audience is so passive. After the session I was told about the deactivation of the wifi to ensure HD streaming quality :-).

See also other screencasts at: http://tv.adam-bien.com or subscribe to http://www.youtube.com/user/bienadam.

See you at Java EE Workshops at Munich Airport or on demand and in a location very near you: airhacks.io!

Real World Java EE Workshops [Airport Munich]>

Geertjan's Blog - October 21, 2014 07:08 PM
Configuring & Running Specific Methods in Maven Projects in NetBeans IDE

In yesterday's blog entry, you saw that a specific test method, i.e., the currently focused test method, can be run, instead of all the test methods, i.e., you have fine-grained control over specifically which test method is executed. However, is it possible to configure that test method, passing in JVM arguments for that specific test method, for example?

Right-click the application and choose Properties, or choose Properties from the File menu, and assuming you're working on a Maven-based application, you'll see the tab below in the Project Properties dialog:

Above, you see the definition of the action that is run when "Test File" is called on a file, which can be done via a menu item or via the keyboard, i.e., by default, Ctrl-6.

Here you can see that I have customized it so that a specific test method is invoked, instead of all the methods in the class:

In the above example, a test method named "testPrintMessage" is run when the "Test File" action, e.g., via Ctrl-6, is performed.

That's because, as my colleague Theofanis told me today, these are Maven commands one can run on the command line, and the above is the equivalents of the below:

mvn -Dtest=a.b.c.MyTest surefire:test would run all tests in MyTest test class

mvn -Dtest=a.b.c.MyTest#testMethodName surefire:test would only run testMethodName in MyTest test class

When you click the Add button above, you are helped in different ways in seeing the options available that can be added:

However, instead of overriding the "Test File" action, you can create custom actions for each method you want to have control over, after you click "Add Custom" below:

After you add a custom action, like above, you can invoke it by right-clicking the file on which you want to run it:

Now, in the Output window, I can see that this is part of the command that NetBeans runs for me when I click the above menu item:

-Dtest=com.mycompany.hello.MainTest#testPrintMessage -Dvertx.timeout=9999

Hope this answers Martijn Verburg's question on Twitter:


Handily, you can also run the custom action directly in the editor, after right-clicking it:

One nice improvement would be if you could map a keyboard shortcut to your custom actions, so you wouldn't have to right-click on a file or in the editor but just press some keys on the keyboard. But simply right-clicking in the editor and then clicking the menu item, as shown above, is not bad at all, pretty handy that you can extend the NetBeans Java Editor with your own custom Maven actions, isn't it? :-)

Once you've created one custom action, like the above, all the next ones are simply a matter of writing in the XML file that is created the first time you create a custom action:

The above "nbactions.xml" file looks as follows, after the steps I took above:

<?xml version="1.0" encoding="UTF-8"?>
        <actionName>CUSTOM-"testPrintMessage" method</actionName>
        <displayName>"testPrintMessage" method</displayName>

So, you want to give yourself the option of running each test method separately? Just copy the action elements above, customize them, and automatically when you right-click the file or in the editor, you'll see a new menu item that connects to the related action in the file above.

Adam Bien - October 21, 2014 01:23 AM
Lazy Injection with javax.inject.Provider

javax.inject.Provider is the minimalistic version of the javax.enterprise.inject.Instance interface. In fact Instance inherits from Provider

For on-demand injection of components / resources inject them as Provider:

public class Index {

    Provider<Boundary> boundary;

    public String getMessage() {
        return boundary.get().message();


The injected component is unaware about the laziness:

public class Boundary {

    public String message() {
        return "Good morning";

Instance comes with additional functionality: see also Interfaces on Demand with CDI and EJB 3.1

[See also an in-depth discussion in the "Real World Java EE Patterns--Rethinking Best Practices" book (Second Iteration, "Green Book"), page 235 in, chapter "Plugin"]

See you at Java EE Workshops at Munich Airport, particularly at: Effective Java EE 7!

Real World Java EE Workshops [Airport Munich]>

Geertjan's Blog - October 20, 2014 05:28 PM
Run Focused Test Method

Want to run a specific test method in NetBeans?

Here's how:

And you can also map a keyboard shortcut so that you can press that whenever you want to run the current test method:

APIDesign - Blogs - October 20, 2014 02:25 PM
Impossible. Part I.

Explaining that something is impossible is, well impossible! Here is a link to one viral video and one story from my computer science student years, which is so true, I would almost cry. In case you find my impossible story interesting, let me know. I have at least two more on the same impossible topic!

--JaroslavTulach 14:25, 20 October 2014 (UTC)

Adam Bien - October 20, 2014 04:16 AM
JavaFX: A Composite View with WYSIWYG

Creating a composite view in JavaFX with Scene Builder and Dependency Injection:

See also: http://afterburner.adam-bien.com and see you at http://workshops.adam-bien.com/javaee-ui.htm.

Real World Java EE Workshops [Airport Munich]>

Geertjan's Blog - October 19, 2014 09:49 AM
NetBeans Translation Tip #2: Do Not Translate USE_MNEMONICS

So you're working on the NetBeans Translators project and you run the application, with its translated bundles, and then you see this error message:

WARNING [org.openide.awt.Toolbar]: Error in AWT task
	at org.openide.awt.Actions.setMenuText(Actions.java:290)
	at org.openide.awt.Actions$MenuBridge.updateState(Actions.java:1266)
	at org.openide.awt.Actions$Bridge.prepare(Actions.java:902)
	at org.openide.awt.Actions$MenuBridge.prepare(Actions.java:1221)
	at org.openide.awt.Actions.connect(Actions.java:201)
	at org.openide.awt.Actions$MenuItem.(Actions.java:1571)
	at org.openide.awt.DynaMenuModel.loadSubmenu(DynaMenuModel.java:138)

You also, assuming you're translating into French and have already translated the text in the error dialog below, see this dialog, once the application has started:

And you're unable to access any of the menu items in the menubar.

An error message that contains "setMenuText(Actions.java:290)" is one that can be figured out by thinking about where menus are defined, in the NetBeans Platform source code. This is done in the UI Utilities API module, which is org-openide-awt.jar.

When I went there, in "LocalizedNetBeans", I found that there are two translated bundle files there, both in French:

Notice the one in blue above. Through a process of trial and error, I discovered that the key "USE_MNEMONICS" should NOT be translated. If you translate USE_MNEMONICS, the error described above occurs. Simply do not include it in the bundle file shown in blue above, in the 'branding/modules/org-openide-awt.jar' folder. Delete it from there, as I did (which is why the file is shown in blue) if you have it there.

And then the problem is solved: the error message above is not shown and menu items can be accessed again, as normal.

PS: Also see tip #1.

Geertjan's Blog - October 18, 2014 07:32 AM
Fixing the Ribbon Bar Integration Tutorial

The NetBeans Platform Ribbon Bar Integration Tutorial has an Installer class that needs to be rewritten if you're using it with NetBeans Platform 8.0 and 8.0.1.

In the Flamingo Integration module, delete the content of the Installer class, in the modules.flamingo package, and replace it with the code shown below:


The problem with the original Installer class in the repo is that it is a little bit hacked together, i.e., it uses the ModuleInstall class, registered in the Manifest, but then delays loading via SwingUtilities.invokeLater. So, when the loading sequence in the NetBeans Platform changes, even slightly, as it does from release to release, with performance enhancements and so on, the hacked code stops working correctly... and the rewritten components, i.e., the ribbon, is loaded incorrectly.

UIDefaults.getUI() failed: no ComponentUI class for: org.pushingpixels.flamingo.internal.ui.ribbon.appmenu.JRibbonApplicationMenuButton[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=16777216,maximumSize=,minimumSize=,preferredSize=]
    at javax.swing.UIDefaults.getUIError(UIDefaults.java:732)
    at javax.swing.MultiUIDefaults.getUIError(MultiUIDefaults.java:130)
    at javax.swing.UIDefaults.getUI(UIDefaults.java:762)
    at javax.swing.UIManager.getUI(UIManager.java:1016)
    at org.pushingpixels.flamingo.internal.ui.ribbon.appmenu.JRibbonApplicationMenuButton.updateUI(JRibbonApplicationMenuButton.java:124)
    at org.pushingpixels.flamingo.api.common.JCommandButton.<init>(JCommandButton.java:433)
    at org.pushingpixels.flamingo.internal.ui.ribbon.appmenu.JRibbonApplicationMenuButton.<init>(JRibbonApplicationMenuButton.java:110)

Until you do the rewrite described in the link above, you'll see the error above when running the application and find the icon in the top left missing, as shown below.

The changed code in the link above fixes the problem.

If you feel the Ribbon application menu button, the big one top left above, is taking up too much space, you can take a look at the com.pinkmatter.modules.flamingo.LAFConfiguration class, and replace one statement with two statements, to use Bruce Schubert's rewritten application menu:

Adam Bien - October 18, 2014 04:31 AM
Setting The Classpath For Nashorn Script in jjs / Java 8

The Java 8 jjs interpreter accepts the -cp / -classpath argument. After setting the classpath, all the classes become available from within the executable script.

A utility class com.airhacks.naslib.Inspector in the naslib.jar (this is an sample jar) becomes available for Nashorn after setting the jjs classpath:

#!/usr/bin/jjs -cp ./naslib/target/naslib.jar -fv
//built-in variable
var args = $ARG;

var Inspector = com.airhacks.naslib.Inspector;
//class from jar, calling a static method

In case this post looks a bit crazy to you, you would enjoy the Java 8 / Java EE 7 "More Power with Less Code" workshop :-).

Real World Java EE Workshops [Airport Munich]>

Adam Bien - October 17, 2014 10:15 AM
Java 8, Nashorn, Nanoservices, JavaFX On-Stage Hacking and Airhacks -- End Of Year Events

See also the the Java EE Microservices workshop in January 2014.

Real World Java EE Workshops [Airport Munich]>

NetBeans Zone - The social network for developers - October 17, 2014 10:02 AM
Taudo Wenzel: My Five Favorite NetBeans IDE Features!

Continuing a series of articles focusing on NetBeans users and their five favorite NetBeans IDE features, here's the next part, by Taudo Wenzel. -- NetBeans team. Preview Text:  "Most devs I know do their Maven builds from the command line (using Eclipse as an IDE) because of unexpected Maven errors that only occur when building inside...

Geertjan's Blog - October 17, 2014 07:37 AM
NetBeans + Java: FIRST Robotics Competition

Seeing this Tweet earlier this week, I had to investigate!

Matt responded: "I attached the only pic I took during our workshop last night with the students first being introduced to Java and NetBeans by Ross Etchells and Briana Hoffman (in the right of the photo) who are software engineers with a local software development company Innovative Software Engineering (ISE) and Mentors on our FIRST Robotics Competition Team. And you can actually see last year's robot in the far background with the big blue ball."

And look really closely and you'll see a few laptops with NetBeans IDE installed!

The group above is using NetBeans IDE as a tool to learn Java as a programming language to control a robot for the FIRST Robotics Competition this coming season.

Below are some links with info on FIRST and FRC, West Branch High School, Team 5041 (which is the above FRC Team), and ISE below.

West Branch, Iowa Schools
Team 5041 Website
Innovative Software Engineering

Watch this space on more around the above group, and others, in the coming months!

NetBeans Zone - The social network for developers - October 16, 2014 08:10 AM
Jonas Felix: My Five Favorite NetBeans IDE Features!

Continuing a series of articles focusing on NetBeans users and their five favorite NetBeans IDE features, here's the next part, by Jonas Felix. -- NetBeans team. Preview Text:  Focusing on Cordova and the Ionic Framework, Jonas Felix describes the key features of NetBeans IDE that make him productive as a Java and JavaScript developer. ...

Geertjan's Blog - October 16, 2014 07:00 AM
YouTube: Profile That PiDrone!

Forget all the small command line tools you typically need to access a remote device, such as a Raspberry Pi. NetBeans IDE connects to the Pi for you and lets you run your application. But... you can also debug the application within NetBeans, while the application is running on the Pi. And, even more impressively, you can use the NetBeans Profiler together with your Pi.

Below, Mark Heckler shows this feature in action with his PiDrone!

&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;span id=&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot;XinhaEditingPostion&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/span&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;span id=&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot;XinhaEditingPostion&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/span&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;span id=&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot;XinhaEditingPostion&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/span&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;

Gualtiero Testa » Netbeans - October 15, 2014 07:00 PM
Tips: NetBeans on Ubuntu

Ubuntu Linux is a very nice software development platform and NetBeans fit very well in it.

Nevertheless few tips can make our developer life easier. These tips can be applied to other Linux distributions.

1. Do not use apt-get

Apt-get is the Ubuntu/Debian tool to download and install programs from the repositories.

It should not be used to install the tools you need for development, NetBeans included.


  • Repositories contains old versions
  • Dependencies force you to install not needed or incompatible software

Get installation files from the main sources and install them manually in a common dir like /opt.

2. Install NetBeans on a user writable dir

NetBeans needs to update files in its own installation directory during software updates. I suggest to use /opt as the main installation dir.

If /opt is now user writable, execute the following command

sudo chmod 777 /opt

3. Watch the /tmp size

NetBeans use /tmp for temporary operations like, for example, updating Central Maven repository information. While doing this update, NetBeans saves big temporary dirs under /tmp and the update fails if /tmp has no space available.

The /tmp dir is usually small when it is mounted on a dedicated partition.

Reserve at least 1.5GByte free space on the /tmp.

See Bug 162313 for more details.

4. Save NetBeans cache in RAM

NetBeans saves configuration, user preferences and project files status in the NetBeans user dir which is located in $HOME/.netbeans/<version>.

Part of this information, mainly related to projects is considered to be a cache (= it can be recreated if deleted); the cache can be located in a separated dir with the command line –cachedir.

With at least 4 GByte RAM, we can map the cache dir to a temporary RAM on disk using Ubuntu native ram filesystem.

My preferred approach is to

- mount the /tmp to a tmpfs type filesystem, by adding the following line in the /etc/fstab

tmpfs /tmp tmpfs defaults,noatime,nosuid,nodev,noexec,mode=1777,size=2048M 0 0

This will “map” the /tmp dir into RAM up to 2GByte (see tip #3).

- map the cachedir to a /tmp/ subdir, by creating a NetBeans invocation script as the following:

export VERSION=netbeans-8.0.1
export RAMDISK=/tmp/$VERSION
export OPTIONS=" --cachedir $RAMDISK --laf Nimbus "
/opt/$VERSION/bin/netbeans $OPTIONS &

The script will invoke NetBeans with the appropriate options.

Note: I like Nimbus on Ubuntu Unity user interface.

5. Use a SSD drive

SSD drives are an impressive speed improvement. Software development requires reading and writing hundred of files. Speed is essential to have quick feedback during our test and compilations cycles.

The SSD drive can be your main hard drive or an external one (possibly on a fast USB connections). Just place both NetBeans installation dir and your projects files on the SSD unit.

Remember to add noatime option on the mount instructions (see /etc/fstab) to avoid useless write access to the disk.

Filed under: Netbeans, Tools Tagged: debian, installation, java, jdk, jre, linux, netbeans, oracle, ubuntu

NetBeans Zone - The social network for developers - October 15, 2014 05:27 PM
Ken Fogel: First Time Attending JavaOne

Ken Fogel is the Program Coordinator and Chairperson of the Computer Science Technology program at Dawson College in Montreal, Canada. He is also a Program Consultant to and part-time instructor in the Computer Institute of Concordia University's School of Extended Learning. Preview Text:  This was my first time attending JavaOne. I...

Adam Bien - October 15, 2014 04:19 PM
Star 7 feat. James Gosling: The Origins of Java ...and iPhone?

Connected and portable touch devices and color screens in ...1992. Java's origins and probably the first appearance of the duke:

Real World Java EE Workshops [Airport Munich]>

Geertjan's Blog - October 15, 2014 07:00 AM
NetBeans in the Latest JAX Magazine

Get the latest JAX Magazine here, with a new article on RESTful Web Services and how trivial it is to create them directly from your database.

NetBeans Zone - The social network for developers - October 15, 2014 05:30 AM
The Best of DZone: Oct. 8 - Oct. 15

THIS WEEK'S TOP LINKS Check out the most popular links shared on DZone from the past week. Be sure to share the best developer links from across the web at DZone.com. Preview Text:  If you missed anything on DZone this week, now's your chance to catch up! This week's best include a tutorial for getting started building mobile apps...

Geertjan's Blog - October 14, 2014 07:55 AM
Oracle Labs to Sponsor R Plugin in NetBeans IDE

Oracle Labs have recently posted a new master thesis description for R support for NetBeans.


If you happen to be or to know a talented student that could do the job, please respond. Either drop a response in the comments to this blog entry, reach me some other way, or contact the initiator of this thesis, Thomas Wuerthinger (thomas dot wuerthinger at oracle dot com) directly.

However, note that you really need to be a very talented and self-motivated programmer. You're not going to focus on simple tasks and you shouldn't be someone who needs constant support and guidance. The bar is pretty high. You should be more or less an expert in R and you should be able to figure out how to provide deep NetBeans features for R, such as syntax highlighting, compilation and running of R code, error reporting, as well as code completion and debugger integration.

Oracle Labs will pay 20h/week for the student working on the master thesis outlined above.

Great news! Looking forward to seeing R take off in NetBeans IDE.

Adam Bien - October 14, 2014 03:39 AM
Named Parameters in Java 8

With Java 8 and the compiler flag: javac -parameters method parameter names are available via reflection. For example: the parameter names of the method hello:

public class Boundary {

    public void hello(String name, int age) {


become accessible to the following code:

    public static void main(String[] args) {
        Method[] methods = Boundary.class.getMethods();
        for (Method method : methods) {
            System.out.print(method.getName() + "(");
            Parameter[] parameters = method.getParameters();
            for (Parameter parameter : parameters) {
                System.out.print(parameter.getType().getName() + " " + parameter.getName() + " ");

Compilation with javac -parameters produces the following output:

hello(java.lang.String name int age )

Without the -parameters flag the names are not available:

hello(java.lang.String arg0 int arg1 )

Real World Java EE Workshops [Airport Munich]>

Geertjan's Blog - October 13, 2014 08:45 PM
Exercise 3 of "Exercises in Porting to the NetBeans Platform"

Pretty awesome! The long-awaited third exercise of "Exercises in Porting to the NetBeans Platform" has been published. The authors start off with the Stocks Monitor application found here and then, step by step, with a lot of explanations and code and screenshots, migrate it to a NetBeans Platform application with all the same functionality as the original application. 

At the end of the exercise, you have an application that looks like this, which monitors financial data from Yahoo Finance.

As always, the authors are looking for your feedback and interaction. The stocks monitoring application will be the basis of subsequent exercises. Right now, it consists of a single module in the application. Subsequent exercises will focus on breaking the application into multiple modules, as well as the integration of the Nodes API and the Explorer & Property Sheet API, among other topics.

I imagine JavaFX charts, and other cool looking JavaFX components, will be integrated into this application in future exercises too! 

You're very highly recommended to get the book, if you're interested in the NetBeans Platform in any way at all:


Required reading for getting started with the above is "NetBeans Platform for Beginners":


The two can be bought together, at a discounted price, here: