0% found this document useful (0 votes)
32 views5 pages

NetBeans IDE for Java Development Guide

This document provides steps for using the NetBeans IDE to develop a "Hello World" Java application and deploy it to run on a Com/PC device. It outlines opening NetBeans, creating a new Java project, writing "Hello World!" to the console, building and running the project locally, and using TFTP to transfer the JAR file to the Com/PC and run it there using Java.

Uploaded by

Manish Pushkar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views5 pages

NetBeans IDE for Java Development Guide

This document provides steps for using the NetBeans IDE to develop a "Hello World" Java application and deploy it to run on a Com/PC device. It outlines opening NetBeans, creating a new Java project, writing "Hello World!" to the console, building and running the project locally, and using TFTP to transfer the JAR file to the Com/PC and run it there using Java.

Uploaded by

Manish Pushkar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Com/PC1 with Embedded Gateway Linux (EGL/2) microHOWTO

How to use the Sun NetBeans IDE for Java Application Development
Java application development is supported by many different tools. One of these tools is the NetBeans IDE (Integrated Development Environment). This very helpful development tool is available free of charge. NetBeans is also a part of some versions of the Sun JDK (Java Development Kit). For more information about NetBeans please visit [Link] The following sample was made with the Sun J2SE Development Kit 5.0 Update 13 with NetBeans IDE 5.5.1 Bundle. The download file was jdk-1_5_0_13-nb-5_5_1-[Link]. The Sun JDK 5 was installed on a Windows XP-based PC. Please see also [Link]: How to write a Hello World for the Java Runtime Environment (JRE). 1. Step: Please run your NetBeans IDE on your development PC. Most NetBeans installations leave an icon on the desktop. Just double-click this icon.

2. Step: Close the NetBeans welcome window. Some parts of this window need an active Internet connection. The Java development with NetBeans is also possible without an active Internet link of your development PC. In this case some help information not available.

3. Step: Open the NetBeans File menu. Then select New Project and create a new Java project. The project category for this sample is General. The project type is Java Application. Then press the Next button. 1

SSV EMBEDDED SYSTEMS 2007, [Link], Rev. 1.00.

Com/PC1 with Embedded Gateway Linux (EGL/2) microHOWTO

4. Step: Select a project name (e.g. JavaApp1) and a project location of your choice. Then press Finish.

5. Step: The NetBeans IDE creates the project environment and a Java source code file as a template. Please replace the line // TODO code application logic here with

SSV EMBEDDED SYSTEMS 2007, [Link], Rev. 1.00.

Com/PC1 with Embedded Gateway Linux (EGL/2) microHOWTO

[Link](Hello World!);

6. Step: Open the Build menu and select Build Main Project. The IDE creates a JAR file for your project.

SSV EMBEDDED SYSTEMS 2007, [Link], Rev. 1.00.

Com/PC1 with Embedded Gateway Linux (EGL/2) microHOWTO

7. Step: Open the Run menu and select the menu item Run Main Project. This starts the execution of your Java application within the NetBeans IDE. Watch the Hello World! output within the output window.

The executable JAR file is located in the dist directory of your project (in this sample the JAR file name is [Link]). Please transfer this JAR file to the Com/PC.

8. Step: Use TFTP and a Telnet or SSH session for transferring the JAR file. Run the JAR file on the Com/PC. Use the following command sequence for this job: cd /rwnv/home/user tftp [Link] binary get [Link] [Link]

SSV EMBEDDED SYSTEMS 2007, [Link], Rev. 1.00.

Com/PC1 with Embedded Gateway Linux (EGL/2) microHOWTO

quit /opt/jre/bin/java jar [Link]

Please note: A JAR file (or Java ARchive) is used for aggregating many files into one. The JAR file is generally used to distribute Java classes and associated metadata. JAR files a typically started with a command line similar to: java jar [Link] or java jar [Link] The means, the JAR file is an executable for the JVM (Java Virtual Machine). A JAR file is a binary file and not a text file. Make sure that your file transfer operates in binary mode. Otherwise the execution with the Com/PC Java VM produces some unclear error messages. That is all.

SSV EMBEDDED SYSTEMS 2007, [Link], Rev. 1.00.

You might also like