Class 1

318 views
183 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
318
On SlideShare
0
From Embeds
0
Number of Embeds
24
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Class 1

  1. 1. Kenia Álava
  2. 2. How to start programming in Java?This part of the study material is not intended to address still concepts, but rather, youcan configure any computer window xp or Windows 7 32 or 64 bit and get it ready to startprogramming.First of all: Installing "jdk-7u7-nb-7_2-windows-i586-ml" JDK "Java Development Kit", willnot only compile but run applications, available for a variety of operating systems: Kenia Álava
  3. 3. METHOD 1: Use the Shell to run Java code. This point is important for you to read andperformers very well using the following commands: • javac.exe, compiler generated files *. Starting class source code (*. Java). The *. Java istext, 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 compiledclass extension). The *. Class have executable code, bytecode, platform independent, tobe executed on a "hypothetical or virtual machine" called Java Virtual Machine (JVM). Isthis JVM neutral who plays this code making a particular code on the CPU used. Thisavoids 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 wherejavac command is located. Kenia Álava
  4. 4. To educate the system accepts this command indicating that we should add "environmentvariables" 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 javaprogram. Kenia Álava
  5. 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 programmingwhile we should not install the JDK, and load the necessary libraries to program withouttread very rodeo.STEP 1: Download and unzip the file indicatedSTEP 2: After that opening the Eclipse IDE, the program requests a folder where you willsave the projects that we believe in java, proceed as indicated in the graph (you must createthe folder previously). Kenia Álava
  6. 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. 7. With the IDE, the only line of code you write play, which was noted belowRun the program with the button, watch out.Further notes what happened in "ProgramasJava2" you created. Kenia Álava

×