java.lang.OutOfMemoryError: Java heap space with NetBeans

Changing the heap size in netbeans.conf only changes the heap for NetBeans itself, not for applications run through NetBeans. The correct way is to right-click on the project and select “Properties” and then “Run”; there you can set the VM options appropriately (-Xmx256m, for instance). It should look something like this: (Thanks to VonC for … Read more

Why can’t I find Java desktop application in Netbeans 7.1

Look here: http://netbeans.org/bugzilla/show_bug.cgi?id=204661 Support for [B]SAF (JSR 296, basically the framework that was behind your “Java Desktop Application” project template) has been abruptly dropped (for no valid reason, let me add). However, as Bill says in his answer, it is not necessary to use the SAF in order to visually design a form. NetBeans swing-designer … Read more

How to set a java compiler in Netbeans

Right click on your project –> Project Properties Then in Sources set Source/Binary Format to JDK 7. EDIT 1 : There is a NetBeans issue: Works fine in J2SE project, Web project specific problem. The problem is that fork=”false” the JDK 7.0 params are passed to JDK 6.0 compiler. The executable requires fork=”true”. On the … Read more

How to use SASS with Netbeans 8.0.1

Installing SASS on Windows10, Ruby2.2.3, Netbeans8 Download SASS for Windows – RubyInstaller.org Install Ruby like: Search windows for CMD (Command Prompt) and start it. Access Ruby’s bin folder using cd \Ruby\bin (Hit Enter) Install sass using the command gem install sass (Hit Enter to install) Wait for the installation to finish In Netbeans open Options … Read more

Configure JPA to let PostgreSQL generate the primary key value

Given the table definition: CREATE TABLE webuser( idwebuser SERIAL PRIMARY KEY, … ) Use the mapping: @Entity @Table(name=”webuser”) class Webuser { @Id @SequenceGenerator(name=”webuser_idwebuser_seq”, sequenceName=”webuser_idwebuser_seq”, allocationSize=1) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator=”webuser_idwebuser_seq”) @Column(name = “idwebuser”, updatable=false) private Integer id; // …. } The naming tablename_columname_seq is the PostgreSQL default sequence naming for SERIAL and I recommend that you … Read more

How to assign more memory to Netbeans?

In the etc directory under your Netbeans-Home, edit the file netbeans.conf file. -Xms and -Xmx should be increased to the values that allow your program to compile. Here are the instructions in netbeans.conf: # Note that default -Xmx and -XX:MaxPermSize are selected for you automatically. # You can find these values in var/log/messages.log file in … Read more

How do I autoindent in Netbeans?

Shortcut: Windows: Alt+Shift+F Mac OS X: Ctrl+Shift+F (note: it’s Ctrl and not ⌘) On using above shortcut, NetBeans indents your selection. If nothing’s selected, it indents the whole file. You can even format multiple files/folders at a time! In the Projects window/sidebar, if you select one or more folders or files and use the shortcut, … Read more