Java 101
-
Upload
javafxpert -
Category
Software
-
view
109 -
download
4
Transcript of Java 101
![Page 1: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/1.jpg)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Java 101A primer on the most used development platform in the world
![Page 2: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/2.jpg)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 2
About the presenter
• James Weaver
– Java Technology Ambassador– Oracle Corporation– Twitter: @JavaFXpert– Email: [email protected]
![Page 3: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/3.jpg)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
About the presenterAuthor of several Java/JavaFX books
![Page 4: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/4.jpg)
4 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
What is Java?
![Page 5: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/5.jpg)
5 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
What is Java?
![Page 6: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/6.jpg)
6 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Java - Computer Science
• Java (programming language), an object-oriented high-level programming language
• Java (software platform), a technology developed by Sun Microsystems for machine-
independent software
– Java Platform, Standard Edition, targets desktop environment
– Java Platform, Enterprise Edition, targets server environment
– Java Platform, Micro Edition, targets mobile devices and embedded systems
– Java Card, targets smart cards and other small memory footprint devices
– Java Class Library, a collection of reusable pieces of software that software developers can use in their
software
– Java Development Kit (JDK), a software bundle from Sun Microsystems aimed at Java developers
– Java Virtual Machine (JVM), part of the Java Platform that is responsible for running software created with
Java
• Java applet, allows software to run in web browers, and is accessible on most PCs
• JavaScript, a web language with no direct relationship to the Java platform
According to Wikipedia
![Page 7: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/7.jpg)
7 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Java
public class HelloWorld
{
public static void main(String args[])
{
System.out.println("Hello World!");
}
}
Programming Language
![Page 8: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/8.jpg)
8 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Life of Java Program
HelloWorld.javajavac
HelloWorld.classHelloWorld.jar
Java Virtual
Machine
![Page 9: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/9.jpg)
9 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Java is Everywhere!
![Page 10: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/10.jpg)
10 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Java Virtual Machine
• Software that runs Java bytecode
![Page 11: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/11.jpg)
11 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Java Virtual Machine
Without changing anything or redeploying your app get:
• Performance Improvements
• Security Updates
• New platforms support
• Enhanced Monitoring Capabilities
Other Advantages of JRE
![Page 12: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/12.jpg)
12 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Developers Love Java!
![Page 13: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/13.jpg)
13 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Java Development Kit
(JDK) Java Runtime Environment
(JRE)
JDK and JRE
javac
Java Virtual
MachineStandard
Libraries
Other
Developer
Tools
![Page 14: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/14.jpg)
14 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Integrated Development Environments
• Several options for Integrated Development Environment
– Commercial and Free products available
Choice is good
![Page 15: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/15.jpg)
15 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Great Performance
• Performance was not a goal for initial release (15+years
ago) but…
• Now performance at par with a well written native
language
• Much better than a poorly written native app (and its
much easier to write a good program in Java)
![Page 16: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/16.jpg)
16 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
You can use Java (VM) if you don’t like Java
• Lots of the advantages, just use another JVM
language and you are still part of the "family”
Many other JVM languages out there and growing
![Page 17: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/17.jpg)
17 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Easy to deploy
• Oracle distributes and updates the runtime on desktops,
you can use applet or webstart to get your program
launched from a website.
• Packager creates self-contained apps and installers for
various platforms.
![Page 18: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/18.jpg)
18 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Java History
1.1
• 1997
• JDBC
1.3
• 2000
• Hotspot
5.0
• 2004
• Generics
7
• 2011
• Oracle Stewardship
1.0
• 1996
1.2
• 1998
• Collections
1.4
• 2002
• JCP
6
• 2006
• JVMTI
![Page 19: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/19.jpg)
19 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.19
Lambda (JSR 335)
Date/Time API (JSR 310)
Type Annotations (JSR 308)
Compact Profiles
Lambda-Form Representation for Method Handles
Remove the Permanent Generation
Improve Contended Locking
Generalized Target-Type Inference
DocTree API
Parallel Array SortingBulk Data Operations
Unicode 6.2
Base64
Prepare for Modularization
Parameter Names
TLS Server Name Indication
Configurable Secure-Random Number Generation
Java 8Nashorn
Enhanced Verification Errors
Fence Intrinsics
Repeating Annotations
HTTP URL Permissions
Limited doPrivileged
![Page 20: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/20.jpg)
20 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
JDK 8 - Highlights
• Lambda (AKA Closures)
– Largest update to the Java Language ever
• 10-30% Performance Improvement “normal” without
changing code for multicore systems/programs
• New APIs like Date and Time
• Nashorn – JavaScript engine for JVM
• Java Mission Control in JDK
© 2014 Oracle
![Page 21: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/21.jpg)
21 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Lambda Expressions
• Lambda expressions represent anonymous functions
– Like a method, has a typed argument list, a return type, a set of
thrown exceptions, and a body
– Not associated with a class
• We now have parameterized behaviour, not just values
Some Details
double highestScore = students.stream().
filter(Student s -> s.getGradYear() == 2011)
mapToDouble(Student s -> s.getScore())
max();
What
How
![Page 22: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/22.jpg)
22 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
New graphics stack - JavaFX
![Page 23: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/23.jpg)
23 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
JavaFX 8
• Predefined shapes
– Box
– Cylinder
– Sphere
• User-defined shapes
– TriangleMesh, MeshView
• PhongMaterial
• Lighting
• Cameras
3D Support
![Page 24: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/24.jpg)
24 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.24
Creating Primitive Shapes and Materials
![Page 25: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/25.jpg)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Using Java Mission ControlAnother cool feature of Java SE Advanced
![Page 26: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/26.jpg)
26 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Built for monitoring, profiling and troubleshooting Java
applications, Java Mission Control consists of:
26
JVM
Java Mission Control
JMX Agent
MBean Server
VM Instrumentation App Instrumentation
• JMX Console for monitoring JVM and application in real time
• Java Flight Recorder for collecting data about JVM and application
• Optional tools via plug-ins (e.g. heap dump analysis, DTrace recording)
![Page 27: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/27.jpg)
27 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Fun Facts about Flight Recorder:
27
• Almost unnoticeable impact on the performance of a Java application running in the JVM (overhead is usually well below 1%)
• High-performance recording engine is built directly into the runtime
• Two JVM startup flags must be enabled on the JVM for which you want to do flight recordings:
-XX:+UnlockCommercialFeatures
-XX:+FlightRecorder
![Page 28: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/28.jpg)
28 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Architects
Love Java
![Page 29: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/29.jpg)
29 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Its Huge, really huge!
• 97% of enterprise desktops run Java
• 1 billion Java downloads each year
• 9 million developers worldwide
• #1 programming language
• More than 3 billion devices are powered by Java
technology
![Page 30: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/30.jpg)
30 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Open Standard
• Java Community Process (JCP) established in 1998
• Establishes Standard Technical Specifications
• Uses Java Specification Requests (JSR)
– Specification
– Reference Implementation
– Technology Compatibility Kit (TCK)
![Page 31: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/31.jpg)
31 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Open Standard –
• No vendor lock-in
– Choose amongst many
– Or go Open Source
• Third-party Java API libraries
exist for virtually any purpose
• OpenJDK contributors
welcomed
What it means to you
![Page 32: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/32.jpg)
32 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Business People
Love Java
![Page 33: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/33.jpg)
33 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Free (Gratis)
• Lots of great goodness and updates available to the
world for no charge
• Deploy in as many servers and desktops as you want
without paying anything
No license cost for use in general purpose computers
![Page 34: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/34.jpg)
34 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Competition Drives Innovation
• Collaborators on the Specification
• Competitors on the implementation
JVM Performance improves continuously
![Page 35: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/35.jpg)
35 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
WORA
• Same skills for mobile, server, client, and even
embedded
Write once, run anywhere
![Page 36: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/36.jpg)
36 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Support and extra tools available
• Enterprise-grade support with long support timeline
available from Oracle
• Additional enterprise and advanced tools available for
licensing from Oracle: Java Advanced and Java Suite.
• Active developer community enables finding help online
for free if you don't want to purchase support
![Page 37: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/37.jpg)
37 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
Backed by Oracle
• Oracle had a vested interest in Java long before it
acquired Sun
– We won’t -can’t- let it fail
• Resources at http://oracle.com/java8
![Page 38: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/38.jpg)
38 Copyright © 2011, Oracle and/or its affiliates. All rights
reserved.
![Page 39: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/39.jpg)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
39
![Page 40: Java 101](https://reader035.fdocuments.in/reader035/viewer/2022062419/55a4e1241a28ab960e8b4789/html5/thumbnails/40.jpg)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Java 101A primer on the most used development platform in the world