Create Projects in NetBeans, and Compile & Execute Code
Setup Netbeans for Full
Remote Development using the Tool Bar
In full remote mode, you
can use the IDE running on your local host to work on projects
that are located on a remote host by using the remote
development tool bar.
Display the tool bar in the IDE
by choosing View
-> Toolbars -> Remote.
You can use the remote tool bar
to select a remote host you have already configured and work on
projects and files on the remote host the same as if they were
local to your client computer.
Click the connection status
icon (the computer icon) to connect to the server selected in
the list next to the icon. Be sure that ece81k[XX]@ezekiel.engr.csufresno.edu
is selected. If you are already connected, clicking the icon
again will disconnect you from the server.
The icon indicates connection
status by turning green when connected and red when not
Creating a New Project
create a new project in NetBeans:
Netbeans for Full Remote Development using the Tool Bar.
Connect to the host account.
2. Click the
Folder icon with the + sign to create a new remote project.
3. Make sure C/C++ is selected under Categories:,
and click on C/C++ Application under Projects:.
4. Choose an appropriate Project
Name: (i.e., HW[X], where [X]
is the current homework number you are working on).
3. Under Project Location,
verify the directory is /home/ece71k/ece71k[XX]/netbeans,
where [XX] is your login number. If this directory is
not selected, type it in for your Project Location.
4. Make sure the Create
Main File box is selected. From the drop down menu,
5. Verify the Build
Host: is ece71k[XX]@ezekiel.engr.csufresno.edu,
where [XX] is your login number.
6. Verify the Tool Collection: is Default
(GNU (GNU)), and click Finish.
You may now begin coding your project.
for Remote Debugging
configure your project for remote debugging:
1. Clean and
Build the Project.
Click on the Project
in the Projects window on the left and select Properties.
Alternatively, select Run ->
Set Project Configuration -> Customize... to
bring up the Properties window.
3. Under Categories, click on Run.
Console Type, choose Standard Output.
5. Click OK to exit the customization
breakpoints, and click the Debug
Including Additional Warnings
from the GCC Compiler
add more warnings from the g++ compiler:
1. Click on
-> Set Project Configuration -> Customize...
2. Under the Build category,
click on C Compiler.
3. Under Warning Level choose
Warnings from the drop down menu.
Choosing this option is the same as adding the -Wall
flag to the linker under Additional Options. If you click on
under Additional Options you will now see the -Wall
flag added to the compiler. I highly recommend using the -Wall
option when compiling your programs, as it provides additional
feedback if there is problem when g++ tries to compile
4. Click OK
to exit the customization options.
Compiling and Executing Code in
you have finished coding, you can compile your code by clicking
on the Build Main Project button (the hammer icon).
Alteratively, press F11. Notice that NetBeans
automatically copies all of your source files over to a
temporary directory on the server, logs into the server, and
then tries to compile it. If you are prompted for a password
when you click the Build Main Project button, type it
in and press Enter.
If you want to delete all temporary files in your project, and
build your program from scratch, click on the Clean and
Build Main Project button (the broom and hammer icon).
Alternatively, press Shift+F11.
If your project compiles successfully, click the Run Main
Project button (the green arrow). Alternatively, press
Since the Run
Main Project button (the green arrow) also compiles
your code, you can press this button the first time you compile
your code if you are reasonably certain your program's syntax is
correct. Most of the time, however, it is wise to first debug
your program and ensure it compiles correctly before attempting
to execute the code.