JBUILDER TUTORIAL
by Jenny Chang
California State University, Los Angeles
June 23, 2003
JBuilder Download &
Installation
In order
to program Java from home, you will need JBuilder. JBuilder is available at no cost. To obtain JBuilder, follow the following steps:
- Point your browser to
http://www.borland.com/products/downloads/download_jbuilder.html
- Under Downloads section,
click on the link for Personal
Version 9 for Windows, Solaris, Linux Platform.
- On the window that pops up
(Borland Account Login Prompt), click on the button for New User.
- On the registration form,
complete the required information and make sure you type a valid email
address. For the company field,
you can type Cal State LA
- Check your email account (the
one that you used for the registration) and click on the link to activate
your account.
- Point your browser to the
link in step 1 again.
- Click on Personal Version 9
and click on the Submit button
on the Terms and conditions window.
- Complete the Borland Survey
- Download the JBuilder 9 Personal
for your operating system (e.g. Windows).
This will take some time to download because the file is around 67.9 - 79.6 Mb for Windows.
I strongly recommend you to download this software at school and
save it in a zip disk unless you have a fast connection at home.
- After you finish downloading
the software, check your email for the registration key. It should be a text file. Download the text file and save it on
your computer. You will need this key to unlock the software so you can
get started.
- Double-click on the setup
file and follow the steps for installing JBuilder.
- When you finish the
installation and first start using JBuilder, it will prompt you to enter
the registration key to unlock the software. Follow the steps to entering the registration key.
- Congratulations! You are on
your way of starting Java programming.
JBuilder Getting Started
The following is a general guideline in getting started in
any Java programming assignment. Please
note that the following steps may vary depending on the version of JBuilder
that you use.
- Open JBuilder
- Click File à New Project…
- The Project Wizard
dialog will appear. Type a name
for your project (e.g. project1)

- Click Next>
- Click Next>
again
- On the last step, click on
the Text field next to the Label field and type the
information as shown in the following screenshot while replacing my name
with your own name:

- Click Finish
- Congratulations, you have now
created a project where all your Java files will reside in. The next step is to create a Java file.
Creating Java a Source File
- While JBuilder is still open,
click File à New…
- On the Object Gallery dialog
window, click on the Class icon and click OK.

- The Class Wizard window will
pop up. Change the Class
name to MyClass, then uncheck everything except for the
Generate header comments option.
- Click OK.

- You should now have something
similar to the following screenshot:

- We are now ready to write a
simple hello world program. Type
the following code inside the class MyClass:

- Now, let us compile our Java
program in order to run it. Click
on the Run Project icon

- The first time when you
compile your Java program, the Runtime Properties window will
appear. You will specify which
Java class contains the main method that we created above. Note: If you ever need to change the
runtime properties in the future, click on Project à Project Properties…
- Click on the ellipse button
to specify the class with the main
method.
- Click on the + sign to
expand the project1 package or folder, and click on MyClass
to select the Java class.

- Click OK.
- Then click OK on the Runtime
Properties window.
- If you have completed the
above steps successfully, you should see the following output in your
screen:

- Save your work, by clicking File
à Save Project As… (The shortcut for this is Ctrl+S).
Locating Your Java Source Files
Remember, it is always a good idea to backup your projects
in a floppy or zip disk. You are also
responsible to periodically backup your projects for this class and any class
that you take in the future.
- JBuilder projects are usually
stored in a folder called jbproject. To locate this folder, do a search by clicking Start à Search à For Files or Folders…

- In the Search for files or
folder named field, Type jbproject. Then click on the Search
Now button. The search results
should appear on the right window.

- Double-click on the jbproject
folder to open it.
- There could be more than one
folders within the jbproject folder. But the folder of interest to us is the project1
folder.
- Double-click on the project1
folder. In the folder you will be
a bunch of files and folders, but only some are of interest to us.

- File project1.jpx is
used by JBuilder. Whenever you
want to open the entire project that you have created, open the file
called project1.jpx in JBuilder.
- Folder src contains
the Java source files with .java extension. Whenever an instructor asks you to submit your source files
(sourcecode), you will usually submit the .java files in this folder.
- Folder named classes contains
the bytecode with .class extension.
These files are used to execute your Java program. They are always generated whenever you
compile your .java source files.