How to create JNLP(Web Start Launcher) from NetBeans 6

Ok now i’m here to show some good feature of Java . Java has a seperate extension like as to the C/C++. Many C/C++ uses .exe(executables) for executing the program in a bundle form . In the same way previously Java uses JAR file as executable but later from Java 2 SE 1.5 the new extension (*.jnlp) had took place for executing the java programs.

Here we are going to create a .jnlp file via NetBeans 6 Ok first create one simple Project which display some GUI. Or you can download sample NetBeans Project from here

Let’s take step by step process:

Press Ctrl+1 and you will see Project tab at your left Pane(for more.. )

Right click on Project Properties then you can see a dialog boxlike as in picture given below:

 

Project Properties

Now you can see there Tree menu ‘Application’ just click on that node and now you can specify your Application Brief:

  • Title
  • Vendor
  • Description
  • Home Page
  • Splash Screen

Title:Here you can specify the title of your program which can be visible at the installation of jnlp file.

Vendor:This vendor is the name of the company you can type which is also visible at installation of jnlp file.

Description : It’s just to give detail info of about the program

Home Page: For the link to your own home page via program installation you can put link here.

Splash Screen: Before opening your program you can show some splash screen like loading image or org image.

After all you can head toward the sub root the Application i.e. ‘Web Start’ now just make click on check box(checked)

‘Enable Web Start’ then now there you will see some stuff like this:

  • Allow Offline
  • Self-signed
  • Application descriptor(Use Project Main Class)
  • Applet descriptor

Allow Offline: This option is to run your program on offline

Self-Signed: This option will just sign your jnlp and jar file from the netbeans with default of 6 month duration

Application descriptor: This option will search the Main.class file in your jar file and run the program while executing jnlp file.

Applet Descriptor: Here you can run your program also in browser by specifying which class to be run (for eg. sample.WebGUI)

After all click ok then . Press F6 then it will start to compile and compress your class files at jar file and run via jnlp.

Then you must be gettting dialog box like this.

JNLP Dialog Box

Just click on Run as it’s only the security warning because our program is not trusted by the Sun java Security. Now your program will run with JNLP file and there you can see your output of your program .

Actually your jnlp file are being created at folder /dist of your project directory. Now if you see you jnlp file codes then your codes some how looks like this.

Code:

codebase attributes defines about the path(directory) of your jnlp file and jar files and then launch.jnlp defines the jnlp file to be executed. with specification of 1.0+

Code:

Here you can see the Information of this jnlp file which defines all the attributes which was defined at NetBeans like title,homepage,description,offline allowed as well.

Code:

Now this is for the security of the jnlp file where there is declaration of all permission to the jnlp file .

Code:

Resources means the supporter file which is needed to run the jnlp file. Likewise here we have supporting file called Sample.jar.

Code:

As we had already mentioned that our program to run on Application Descriptor instead of Applet and Component Descriptor. So here our xml presents application Descriptor to run the file Main.class which is located at the package named sample which package is taken from the supporting file named sample.jar.

If any error are just evolved then comment at the blog you are welcomed.

9 thoughts on “How to create JNLP(Web Start Launcher) from NetBeans 6”

  1. Pingback: Java

  2. This was really informative! I thanks for the info! I’m not a newbie and even I learned some great things from this one. One thing though… I can’t seem to get your RSS feed link to work. Can you help me with that?

  3. The steps are same . There wont’ be any vast change I guess. Right Click Project>Properties>Application>WebStart> Check “Enable Web Start” then select appropriate class and click on Ok! Finally Click on Clean and Build Icon(Shift+F11).

    Thanks
    Narayan

Leave a Reply