SlideShare une entreprise Scribd logo
1  sur  32
Télécharger pour lire hors ligne
Java goes wild 
Lesson 1: Introduction to Java 
Thierry Wasylczenko
After this course ... 
You will: 
• Know what is the JDK/JRE 
• Be able to set up your development environment 
• Know how to compile and run a Java program 
2
Agenda 
• Bascis 
• How does all of this work? 
• Developer’s environment 
3
Basics 
Success is neither magical nor mysterious. Success is the natural 
consequence of consistently applying the basic fundamentals. 
Jim Rohn “ 
4
Basics 
• Source code is inside files with .java extension 
• The source code is compiled into .class files 
• The class files are executed by a strange thing (covered later) 
5
A Java file 
public class Foo { 
public static void main(String[] args) { 
System.out.println("Hello World!"); 
} 
} 
6
How do I get class files? 
• By compiling all Java files 
$ cd /location/of/java/files 
$ javac Foo.java 
$ ls 
Foo.class Foo.java 
$ 
7
How do I run it? 
• With the java command 
$ java Foo 
Hello World! 
$ 
• Yes you DON’T put the .class extension when you run a class ! 
8
Java Archive 
• aka JAR 
• A collection of compiled Java classes 
• Package of a Java program 
• Can be runnable 
java -jar Foo.jar 
9
That's 
freaking 
AWESOME !
That’s awesome dude. But how 
does all of this work? 
You “ 
11
12 
How does all of this work? 
It is not the beauty of a building you should look at; it's the construction 
of the foundation that will stand the test of time. 
David Allan Coe “
The source code 
• Plain text file 
• File extension: .java 
• Rules for naming each file (covered later) 
13
The bytecode 
14 
• Result of compilation 
• Something in between the source code and the machine’s language 
• Interpreted by the Java Virtual Machine
The Java Virtual Machine 
• aka the JVM 
• Kind of a black box 
• Interprets the Java bytecode 
• Is available on major platforms 
• "Compile once, run everywhere" 
15
A little schema 
Source 
code 
Source 
code 
Byte code JVM 
Byte code JVM 
turns on 
turns on 
java 
java 
javac 
javac 
16
Well man, you’re talking about 
JVM, javac, bytecode and cool 
stuff. But how do I set them up? 
You “ 
17
18 
Developer's environment 
When people think about computer science, they imagine people with 
pocket protectors and thick glasses who code all night. 
Marissa Mayer “
Java Development Kit 
• aka JDK 
• Provides tools 
• javac: java compiler 
• javadoc: generates the documentation 
• ... 
• Includes a Java Runtime Environment 
19
Java Runtime Environment 
• aka JRE 
• Provides tools: 
• java: for running Java applications 
• ... 
20
JAVA_HOME 
• An environment variable 
• Points to the JDK installation 
• Required by some tools such as: 
• IDEs 
• build tools (maven, gradle, ...) 
• ... 
• Used to update the PATH variable 
21
JAVA_HOME: example 
# Unix 
export JAVA_HOME="/path/to/jdk" 
export PATH=$JAVA_HOME/bin:$PATH 
REM Windows 
set JAVA_HOME="C:pathtojdk" 
set PATH=%JAVA_HOME%bin;%PATH% 
22
Avoid spaces in the path of your 
JAVA_HOME. 
JAVA_HOME 
23
JAVA_HOME: test the setup 
To test the setup you can execute the following command: 
24 
$ java -version 
java version "1.8.0_11" 
Java(TM) SE Runtime Environment (build 1.8.0_11-b12) 
Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)
What does JRE stand for? 
• Java Runtime Embeded 
• Java Routine Exclusive 
• Java Runtime Environment 
Start Stop 
25
What is the correct command to 
execute a Java program? 
• java Foo.java 
• java Foo 
• java Foo.class 
Start Stop 
26
1. Set the JAVA_HOME in your 
environment 
2. Verify your setup 
Practice #1 
27
Practice #2 
Given the following code: 
public class Foo { 
public static void main(String[] args) { 
System.out.println("Hello World!"); 
} 
} 
28
1. Copy it in your favorite editor 
2. Save the file as Foo.java 
3. Compile it 
4. Run it 
Practice #2 
29
30
31 
Appendix
Appendix 
• Java Code conventions 
• Not maintained since 1997, may not be accurate 
32

Contenu connexe

Tendances

DevNexus 2019: Migrating to Java 11
DevNexus 2019: Migrating to Java 11DevNexus 2019: Migrating to Java 11
DevNexus 2019: Migrating to Java 11DaliaAboSheasha
 
Using Play Framework 2 in production
Using Play Framework 2 in productionUsing Play Framework 2 in production
Using Play Framework 2 in productionChristian Papauschek
 
Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)Saeed Zarinfam
 
Android secure offline storage - CC Mobile
Android secure offline storage - CC MobileAndroid secure offline storage - CC Mobile
Android secure offline storage - CC MobileSteve De Zitter
 
JavaScript unit testing with Jasmine
JavaScript unit testing with JasmineJavaScript unit testing with Jasmine
JavaScript unit testing with JasmineYuval Dagai
 
Node.js Development with Apache NetBeans
Node.js Development with Apache NetBeansNode.js Development with Apache NetBeans
Node.js Development with Apache NetBeansRyan Cuprak
 
Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules uploadRyan Cuprak
 
Building and Managing Projects with Maven
Building and Managing Projects with MavenBuilding and Managing Projects with Maven
Building and Managing Projects with MavenKhan625
 
My first powershell script
My first powershell scriptMy first powershell script
My first powershell scriptDavid Cobb
 
Designing a play framework application
Designing a play framework applicationDesigning a play framework application
Designing a play framework applicationVulcanMinds
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...Hackito Ergo Sum
 

Tendances (13)

Maven
Maven Maven
Maven
 
DevNexus 2019: Migrating to Java 11
DevNexus 2019: Migrating to Java 11DevNexus 2019: Migrating to Java 11
DevNexus 2019: Migrating to Java 11
 
Using Play Framework 2 in production
Using Play Framework 2 in productionUsing Play Framework 2 in production
Using Play Framework 2 in production
 
Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)
 
Android secure offline storage - CC Mobile
Android secure offline storage - CC MobileAndroid secure offline storage - CC Mobile
Android secure offline storage - CC Mobile
 
Omfw 2013
Omfw 2013Omfw 2013
Omfw 2013
 
JavaScript unit testing with Jasmine
JavaScript unit testing with JasmineJavaScript unit testing with Jasmine
JavaScript unit testing with Jasmine
 
Node.js Development with Apache NetBeans
Node.js Development with Apache NetBeansNode.js Development with Apache NetBeans
Node.js Development with Apache NetBeans
 
Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules upload
 
Building and Managing Projects with Maven
Building and Managing Projects with MavenBuilding and Managing Projects with Maven
Building and Managing Projects with Maven
 
My first powershell script
My first powershell scriptMy first powershell script
My first powershell script
 
Designing a play framework application
Designing a play framework applicationDesigning a play framework application
Designing a play framework application
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
 

Similaire à Java goes wild, lesson 1

Introduction to java
Introduction to java Introduction to java
Introduction to java Java Lover
 
Pj01 2-install java and write first java program
Pj01 2-install java and write first java programPj01 2-install java and write first java program
Pj01 2-install java and write first java programSasidharaRaoMarrapu
 
OOP Lecture 1-Intro to Java.pptx
OOP Lecture 1-Intro to Java.pptxOOP Lecture 1-Intro to Java.pptx
OOP Lecture 1-Intro to Java.pptxTanzila Kehkashan
 
basic core java up to operator
basic core java up to operatorbasic core java up to operator
basic core java up to operatorkamal kotecha
 
1 java programming- introduction
1  java programming- introduction1  java programming- introduction
1 java programming- introductionjyoti_lakhani
 
Fundamentals of java --- version 2
Fundamentals of java --- version 2Fundamentals of java --- version 2
Fundamentals of java --- version 2Uday Sharma
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to javaattiqrocket
 
The Evolution of Java
The Evolution of JavaThe Evolution of Java
The Evolution of JavaFu Cheng
 
How to implement a simple dalvik virtual machine
How to implement a simple dalvik virtual machineHow to implement a simple dalvik virtual machine
How to implement a simple dalvik virtual machineChun-Yu Wang
 
JavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesJavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesCharles Nutter
 
JavaFX - Sketch Board to Production
JavaFX - Sketch Board to ProductionJavaFX - Sketch Board to Production
JavaFX - Sketch Board to ProductionYoav Aharoni
 
01. Introduction to programming with java
01. Introduction to programming with java01. Introduction to programming with java
01. Introduction to programming with javaIntro C# Book
 
Java Programming and J2ME: The Basics
Java Programming and J2ME: The BasicsJava Programming and J2ME: The Basics
Java Programming and J2ME: The Basicstosine
 
Mastering Java Bytecode - JAX.de 2012
Mastering Java Bytecode - JAX.de 2012Mastering Java Bytecode - JAX.de 2012
Mastering Java Bytecode - JAX.de 2012Anton Arhipov
 

Similaire à Java goes wild, lesson 1 (20)

Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Pj01 2-install java and write first java program
Pj01 2-install java and write first java programPj01 2-install java and write first java program
Pj01 2-install java and write first java program
 
OOP Lecture 1-Intro to Java.pptx
OOP Lecture 1-Intro to Java.pptxOOP Lecture 1-Intro to Java.pptx
OOP Lecture 1-Intro to Java.pptx
 
basic core java up to operator
basic core java up to operatorbasic core java up to operator
basic core java up to operator
 
java swing
java swingjava swing
java swing
 
1 java programming- introduction
1  java programming- introduction1  java programming- introduction
1 java programming- introduction
 
1.Intro--Why Java.pptx
1.Intro--Why Java.pptx1.Intro--Why Java.pptx
1.Intro--Why Java.pptx
 
Java part 1
Java part 1Java part 1
Java part 1
 
Fundamentals of java --- version 2
Fundamentals of java --- version 2Fundamentals of java --- version 2
Fundamentals of java --- version 2
 
Lesson1 intro
Lesson1 introLesson1 intro
Lesson1 intro
 
Lesson1 intro
Lesson1 introLesson1 intro
Lesson1 intro
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
The Evolution of Java
The Evolution of JavaThe Evolution of Java
The Evolution of Java
 
How to implement a simple dalvik virtual machine
How to implement a simple dalvik virtual machineHow to implement a simple dalvik virtual machine
How to implement a simple dalvik virtual machine
 
JavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesJavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for Dummies
 
JavaFX - Sketch Board to Production
JavaFX - Sketch Board to ProductionJavaFX - Sketch Board to Production
JavaFX - Sketch Board to Production
 
01. Introduction to programming with java
01. Introduction to programming with java01. Introduction to programming with java
01. Introduction to programming with java
 
JAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptx
JAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptxJAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptx
JAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptx
 
Java Programming and J2ME: The Basics
Java Programming and J2ME: The BasicsJava Programming and J2ME: The Basics
Java Programming and J2ME: The Basics
 
Mastering Java Bytecode - JAX.de 2012
Mastering Java Bytecode - JAX.de 2012Mastering Java Bytecode - JAX.de 2012
Mastering Java Bytecode - JAX.de 2012
 

Plus de Thierry Wasylczenko

Du développement à la livraison avec JavaFX et le JDK9
Du développement à la livraison avec JavaFX et le JDK9Du développement à la livraison avec JavaFX et le JDK9
Du développement à la livraison avec JavaFX et le JDK9Thierry Wasylczenko
 
Construire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleConstruire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleThierry Wasylczenko
 
#Polyglottisme, une autre manière de développer une application
#Polyglottisme, une autre manière de développer une application#Polyglottisme, une autre manière de développer une application
#Polyglottisme, une autre manière de développer une applicationThierry Wasylczenko
 

Plus de Thierry Wasylczenko (8)

Du développement à la livraison avec JavaFX et le JDK9
Du développement à la livraison avec JavaFX et le JDK9Du développement à la livraison avec JavaFX et le JDK9
Du développement à la livraison avec JavaFX et le JDK9
 
JavaFX et le JDK9
JavaFX et le JDK9JavaFX et le JDK9
JavaFX et le JDK9
 
#JavaFX.forReal() - ElsassJUG
#JavaFX.forReal() - ElsassJUG#JavaFX.forReal() - ElsassJUG
#JavaFX.forReal() - ElsassJUG
 
#JavaFX.forReal()
#JavaFX.forReal()#JavaFX.forReal()
#JavaFX.forReal()
 
Construire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleConstruire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradle
 
#Polyglottisme, une autre manière de développer une application
#Polyglottisme, une autre manière de développer une application#Polyglottisme, une autre manière de développer une application
#Polyglottisme, une autre manière de développer une application
 
JavaFX, because you're worth it
JavaFX, because you're worth itJavaFX, because you're worth it
JavaFX, because you're worth it
 
Introduction to JavaFX 2
Introduction to JavaFX 2Introduction to JavaFX 2
Introduction to JavaFX 2
 

Dernier

College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 

Dernier (20)

College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 

Java goes wild, lesson 1

  • 1. Java goes wild Lesson 1: Introduction to Java Thierry Wasylczenko
  • 2. After this course ... You will: • Know what is the JDK/JRE • Be able to set up your development environment • Know how to compile and run a Java program 2
  • 3. Agenda • Bascis • How does all of this work? • Developer’s environment 3
  • 4. Basics Success is neither magical nor mysterious. Success is the natural consequence of consistently applying the basic fundamentals. Jim Rohn “ 4
  • 5. Basics • Source code is inside files with .java extension • The source code is compiled into .class files • The class files are executed by a strange thing (covered later) 5
  • 6. A Java file public class Foo { public static void main(String[] args) { System.out.println("Hello World!"); } } 6
  • 7. How do I get class files? • By compiling all Java files $ cd /location/of/java/files $ javac Foo.java $ ls Foo.class Foo.java $ 7
  • 8. How do I run it? • With the java command $ java Foo Hello World! $ • Yes you DON’T put the .class extension when you run a class ! 8
  • 9. Java Archive • aka JAR • A collection of compiled Java classes • Package of a Java program • Can be runnable java -jar Foo.jar 9
  • 11. That’s awesome dude. But how does all of this work? You “ 11
  • 12. 12 How does all of this work? It is not the beauty of a building you should look at; it's the construction of the foundation that will stand the test of time. David Allan Coe “
  • 13. The source code • Plain text file • File extension: .java • Rules for naming each file (covered later) 13
  • 14. The bytecode 14 • Result of compilation • Something in between the source code and the machine’s language • Interpreted by the Java Virtual Machine
  • 15. The Java Virtual Machine • aka the JVM • Kind of a black box • Interprets the Java bytecode • Is available on major platforms • "Compile once, run everywhere" 15
  • 16. A little schema Source code Source code Byte code JVM Byte code JVM turns on turns on java java javac javac 16
  • 17. Well man, you’re talking about JVM, javac, bytecode and cool stuff. But how do I set them up? You “ 17
  • 18. 18 Developer's environment When people think about computer science, they imagine people with pocket protectors and thick glasses who code all night. Marissa Mayer “
  • 19. Java Development Kit • aka JDK • Provides tools • javac: java compiler • javadoc: generates the documentation • ... • Includes a Java Runtime Environment 19
  • 20. Java Runtime Environment • aka JRE • Provides tools: • java: for running Java applications • ... 20
  • 21. JAVA_HOME • An environment variable • Points to the JDK installation • Required by some tools such as: • IDEs • build tools (maven, gradle, ...) • ... • Used to update the PATH variable 21
  • 22. JAVA_HOME: example # Unix export JAVA_HOME="/path/to/jdk" export PATH=$JAVA_HOME/bin:$PATH REM Windows set JAVA_HOME="C:pathtojdk" set PATH=%JAVA_HOME%bin;%PATH% 22
  • 23. Avoid spaces in the path of your JAVA_HOME. JAVA_HOME 23
  • 24. JAVA_HOME: test the setup To test the setup you can execute the following command: 24 $ java -version java version "1.8.0_11" Java(TM) SE Runtime Environment (build 1.8.0_11-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)
  • 25. What does JRE stand for? • Java Runtime Embeded • Java Routine Exclusive • Java Runtime Environment Start Stop 25
  • 26. What is the correct command to execute a Java program? • java Foo.java • java Foo • java Foo.class Start Stop 26
  • 27. 1. Set the JAVA_HOME in your environment 2. Verify your setup Practice #1 27
  • 28. Practice #2 Given the following code: public class Foo { public static void main(String[] args) { System.out.println("Hello World!"); } } 28
  • 29. 1. Copy it in your favorite editor 2. Save the file as Foo.java 3. Compile it 4. Run it Practice #2 29
  • 30. 30
  • 32. Appendix • Java Code conventions • Not maintained since 1997, may not be accurate 32