Monday, May 28, 2018

Portable Netbeans

NetBeans IDE is a free and open source integrated development environment.
“Quickly and easily develop desktop, mobile and web applications
with Java, JavaScript, HTML5, PHP, C/C++ and more.”

Netbeans IDE is often just called Netbeans.

Note: If you can, install the latest executable Netbeans IDE, which will give you the option to keep the program auto updated.

But if due to your company’s security policies, you are not be able to update to the latest required NetBeans or even install the NetBeans executable (exe), you can often download and use the portable versions of programs, often distributed as zip, tar, or gz files.

Or maybe you just want a portable and easy to backup version of the NetBeans.

Download the latest version of Netbeans.

Note: Netbeans used to be developed by Oracle, but is currently moving to Apache.
Either download the latest stable version from Oracle, or the latest beta from Apache (as of this post)

Netbeans 8.2 (Oracle)
https://netbeans.org/downloads/

Be sure to switch the Platform dropdown to OS Independent Zip
Then download the appropriate environment
If in doubt, All will suffice.



Netbeans Beta 9.0 (Apache)
http://netbeans.incubator.apache.org/download/nb90/nb90-beta.html
http://netbeans.incubator.apache.org




Extract either download to a directory, such as
C:\Portable\Netbeans

Note: BandiZip is a good free archive (zip) program
To run Netbeans, you must have a Java JRE installed or a portable copy.
Note: This Blog post will show you how to create a portable copy of the Java JRE
Portable Java


If using a portable version of the Java JRE,
Edit the Netbeans configuration file to tell Netbeans where your portable version of Java JRE is located.

Open the file
C:\Portable\Netbeans\etc\netbeans.conf




Note: Notepad++ is a good free text editor, which can also be used portable
just download the zip or 7z version.


Find the string (CTRL F or scroll and read)
#netbeans_jdkhome="/path/to/jdk"

And change it to where you installed/extracted the Java JRE
Such as
netbeans_jdkhome="C:\Portable\jre1.8.0_161"
Or
netbeans_jdkhome="C:\Portable\jre-10.0.1"

Note the removal of the comment tag #

Save and close and try to run Netbeans

Create a shortcut to the Netbeans executable, which is in
C:\Portable\Netbeans\bin\




Choose netbeans64.exe if you are using a 64bit OS (most likely)
else choose netbeans.exe

Netbeans should be up and running.

Program away!




Additional information

If your company policy locks down your installation options, more than likely you are on ‘less than optimal’ hardware. If your laptop or desktop only has 4gb memory, this change can help the performance of Netbeans

Edit the Netbeans configuration file again
C:\Portable\Netbeans\etc\netbeans.conf

Find the string
netbeans_default_options

Place a comment mark # in front of it, so you can reset the configuration if need be
#netbeans_default_options

And create a new entry
netbeans_default_options="-J-client -J-Xss8m -J-Xms256m -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.dpiaware=true -J-Dsun.zip.disableMemoryMapping=true -J-Djava.net.preferIPv4Stack=true -J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled -J-XX:+CMSPermGenSweepingEnabled"

-J-Xss8m -J-Xms256m allows Netbeans to start up a little faster, and caps it’s memory usage.

Further details of options
https://performance.netbeans.org/howto/jvmswitches/

Additional ideas
https://stackoverflow.com/questions/229763/how-to-improve-netbeans-performance

With two semi-obvious ones being
Disable the Netbeans plugins you are not using.
Close the projects you are not working on (Netbeans keeps an index on every project opened)

End of document. Thanks for reading.

No comments:

Post a Comment