+ All Categories
Home > Software > Java 101

Java 101

Date post: 14-Jul-2015
Category:
Upload: javafxpert
View: 108 times
Download: 4 times
Share this document with a friend
Popular Tags:
40
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Java 101 A primer on the most used development platform in the world
Transcript
Page 1: Java 101

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

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

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

About the presenterAuthor of several Java/JavaFX books

Page 4: Java 101

4 Copyright © 2011, Oracle and/or its affiliates. All rights

reserved.

What is Java?

Page 5: Java 101

5 Copyright © 2011, Oracle and/or its affiliates. All rights

reserved.

What is Java?

Page 6: Java 101

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

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

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

9 Copyright © 2011, Oracle and/or its affiliates. All rights

reserved.

Java is Everywhere!

Page 10: Java 101

10 Copyright © 2011, Oracle and/or its affiliates. All rights

reserved.

Java Virtual Machine

• Software that runs Java bytecode

Page 11: Java 101

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

12 Copyright © 2011, Oracle and/or its affiliates. All rights

reserved.

Developers Love Java!

Page 13: Java 101

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

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

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

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

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

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

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

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

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

22 Copyright © 2011, Oracle and/or its affiliates. All rights

reserved.

New graphics stack - JavaFX

Page 23: Java 101

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

24 Copyright © 2011, Oracle and/or its affiliates. All rights

reserved.24

Creating Primitive Shapes and Materials

Page 25: Java 101

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Using Java Mission ControlAnother cool feature of Java SE Advanced

Page 26: Java 101

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

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

28 Copyright © 2011, Oracle and/or its affiliates. All rights

reserved.

Architects

Love Java

Page 29: Java 101

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

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

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

32 Copyright © 2011, Oracle and/or its affiliates. All rights

reserved.

Business People

Love Java

Page 33: Java 101

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

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

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

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

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

38 Copyright © 2011, Oracle and/or its affiliates. All rights

reserved.

Page 39: Java 101

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

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Java 101A primer on the most used development platform in the world


Recommended