2. How to start programming in Java?
This part of the study material is not intended to address still concepts, but rather, you
can configure any computer window xp or Windows 7 32 or 64 bit and get it ready to start
programming.
First of all: Installing "jdk-7u7-nb-7_2-windows-i586-ml" JDK "Java Development Kit", will
not only compile but run applications, available for a variety of operating systems:
Kenia Álava
3. METHOD 1: Use the Shell to run Java code. This point is important for you to read and
performers very well using the following commands:
• javac.exe, compiler generated files *. Starting class source code (*. Java). The *. Java is
text, you can create and edit in a text editor, using the syntax of Java.
• Java.exe, systems interpreter for PC / Windows, executes bytecode files (files compiled
class extension). The *. Class have executable code, bytecode, platform independent, to
be executed on a "hypothetical or virtual machine" called Java Virtual Machine (JVM). Is
this JVM neutral who plays this code making a particular code on the CPU used. This
avoids having to make a different program for each CPU or platform.
Shell enters the system and see what happens when Digitas commands: java or javac.
You will realize that the javac command is not enabled, therefore the following steps and
then try to use the command in question, the difference observed.
Remember watching the second image of this manual and look at the directory where
javac command is located.
Kenia Álava
4. To educate the system accepts this command indicating that we should add "environment
variables" as indicated in the graph.
Creating our first program in java then install an editor to start coding (in this case Notepad
+ +) After that, create the following program and save it in the directory "c:
ProgramasJava"
Note that the name of the file must be named identical to the class, using case sensitive.
Finally run the program, first compile the program with javac and then running the java
program.
Kenia Álava
5. Method 2: Using the Eclipse integrated development (Available at www.eclipse.org -
Section "downloads" download the Eclipse Classic 4.2)
This method is much faster than before, it is a method of abstraction for programming
while we should not install the JDK, and load the necessary libraries to program without
tread very rodeo.
STEP 1: Download and unzip the file indicated
STEP 2: After that opening the Eclipse IDE, the program requests a folder where you will
save the projects that we believe in java, proceed as indicated in the graph (you must create
the folder previously).
Kenia Álava
6. STEP 3: Follow the following sequence of actions to create a project in java.
Look what happens next.
Now insert a class as follows
Kenia Álava
7. With the IDE, the only line of code you write play, which was noted below
Run the program with the button, watch out.
Further notes what happened in "ProgramasJava2" you created.
Kenia Álava