0% found this document useful (0 votes)
59 views

Popular Downloads Like NetBeans

Java SE Development Kit (JDK) includes the Java Runtime Environment (JRE) and command-line development tools. The JDK has two version numbers -- external version number 5. And internal version number 1.5.0.

Uploaded by

rolinjarvis
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 DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views

Popular Downloads Like NetBeans

Java SE Development Kit (JDK) includes the Java Runtime Environment (JRE) and command-line development tools. The JDK has two version numbers -- external version number 5. And internal version number 1.5.0.

Uploaded by

rolinjarvis
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 DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Getting Started

Download the latest SDK (Software Development Kit):


The Java SE Development Kit (JDK) includes the Java Runtime Environment (JRE) and command-line development
tools that are useful for developing applets and applications.

Select Java SE from the list of Downloads list on this website:

http://java.sun.com/

Setting the PATH variable:


This website explains how to set the PATH variable. You’ll need to set your PATH
variable to the bin directory that you downloaded your JDK to. It will be something like
C:\Program Files\Java\jre1.6.1\bin.

1. Verify that your PATH variable was set properly:


Start your command prompt and test that your compiler is found:
C:> javac –version
…….jre1.6.1

2. Create a folder where you will create your Java applications.


I have created a folder to practice Java:
C:\Documents and Settings\cgregorek\My Documents\CTU\IT271

The problems you may encounter


Caution – Studio Enterprise software 8.1 does not support
Java™ SE Development Kit (JDK) 6. For more information, see Sun Java Studio
Enterprise 8.1 Release Notes.

To download the archived JDK 1.5.0 if you really want to use Studio 8.1
Note - The JDK has two version numbers -- external version number 5.0 and internal version number
1.5.0.

https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-
Site/en_US/-/USD/ViewFilteredProducts-
SingleVariationTypeFilter;pgid=yYdgaHqkkjVSR0EUPIQsoQ3D0000mRRLNX4P;sid=b25upMnEOS5upIHr_AAmoSZiVu
cDUwSBOoyhZdTaBFww8g==

Caution - Studio Enterprise 8.1 won’t run on Vista

Note - Default login for Studio


admin/adminadmin

Solution: NetBeans

The NetBeans IDE 6.0 provides the same UML Modeling, Developer Collaboration,
Profiler, and Portlet Builder features that were offered in the Sun Java Studio Enterprise
IDE 8.1. It is a graphical IDE (Integrated Development Environment) which you can
download from:

http://www.netbeans.org/
Solution: JEdit

If you prefer to simply write your Java code from scratch and compile/run from the
command line, I’d like to recommend JEdit. It is a syntax sensitive editor:

http://www.jedit.org/

Here is a website that explains how to set up JEdit so it is more friendly:

http://www.cs.princeton.edu/introcs/11hello/windows-jedit.html
Setting options for your Command Prompt window (if you are not using
an IDE to do your builds and run your programs):
You will actually compile and run your java programs from the command prompt.

Start ->All Programs -> Accessories-> Command Prompt

I have created a desktop shortcut making it easier to get to my Command Prompt.

To make it MUCH easier to compile and run Java applications, I strongly encourage you to change
these options for your Command Prompt. You can change the options by right mouse clicking the title
bar and selecting ‘properties’:

Set Layout->Screen Buffer to 80 x 500


Set Options -> Edit Options -> Quick Edit Mode
Set Options -> Edit Options -> Insert Mode.
Set Options -> Command History Buffer Size to 500

You can also change the colors of the font and background if you’d like.

Click OK and “Modify shortcut that started this window” to make the changes permanent for the
shortcut.
Command Prompt Shortcuts:

There are also a few helpful keyboard shortcuts:

 F7 pops up your command history. ESC will close this.


 UP arrow selects a previous command from your command history. DOWN arrow selects the
next command.
 To make it easier to change directories, type cd: and then drag n' drop folders from an explorer
window into the command prompt. This will insert the quoted path after your cd command.
 ALT+ENTER takes your command prompt to fullscreen mode and back again.

More on Command Prompt Shortcuts:

http://smallvoid.com/article/winnt-command-prompt-shortcuts.html

Compiling and running your first program using JEdit

Type your first program. Type this exactly as you see it in your JEdit window and save
it.

Note: Make sure the name o f your file corresponds to the name of the public class of the file. If
main() is within the public class, then the name of the file should be the public class holding main().

Save as “HelloWorld.java”

Now you are ready to compile and run. You do this in your command prompt window
First compile:
C:\Documents and Settings\cgregorek\My Documents\CTU\IT271> javac HelloWorld.java

List the contents of the directory to verify the class file was built: HelloWorld.class:
C:\Documents and Settings\cgregorek\My Documents\Training\Java Sandbox> dir

Run your application:

C:\Documents and Settings\cgregorek\My Documents\CTU\IT271> java HelloWorld

You should see Hello, World printed to the screen:

Everything is case sensitive! Your commands, filenames, and contents of


your program!

You might also like