Intro to Java Technology

20
Java Technology Jussi Pohjolainen Tampere University of Applied Sciences

description

 

Transcript of Intro to Java Technology

Page 1: Intro to Java Technology

Java Technology

Jussi PohjolainenTampere University of Applied Sciences

Page 2: Intro to Java Technology

INTRODUCTION TO JAVA TECHNOLOGY

Page 3: Intro to Java Technology

Introduction to Java

• Java is a programming language developed by James Gosling at Sun Microsystems

• Released in 1995• Syntax derived from C and C++

Page 4: Intro to Java Technology

History

• Java 1.0 in 1995• Initial Success:– Write Once Run Anywhere (WORA)– Web Browsers incorporated the ability to run small

Java – programs called Applets• Java 2 was introduced in 1998, divided into three

categories:– Java2 Enterprise Edition (J2EE)– Java2 Standard Edition (J2SE)– Java2 Micro Edition (J2ME)

Page 5: Intro to Java Technology

Today

• In 2006 Sun renamed Java 2 versions– Java EE– Java SE– Java ME

• Java versioning: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5 and 1.6 (which is the current)

• Most popular programming language!– http://www.tiobe.com/index.php/content/

paperinfo/tpci/index.html

Page 6: Intro to Java Technology

Java on Desktop: SwingSet demo

Page 7: Intro to Java Technology

Java on Mobile: Opera Mini

Page 8: Intro to Java Technology

Java on Server: Etuovi.com

Page 9: Intro to Java Technology

Java's Future?• Very few Java desktop apps– Sluggish performance?– Why use Java when you have Qt?

• Popular on the enterprise and mobile side– Mobile programming is under heavy turbulence at the

moment: • Nokia's Qt (C++)• Apple's iPhone (Objective-C)• Google's Android (Java)

• Sun Microsystem's financial trouble, Oracle bought Sun in April 2009!

Page 10: Intro to Java Technology

Compiling Java Apps

http://java.sun.com/docs/books/tutorial/getStarted/intro/definition.html

Page 11: Intro to Java Technology

Compiling Qt Apps

http://www.symbianresources.com/tutorials/qt/01-QtIntroduction.pdf

Page 12: Intro to Java Technology

JAVA TOOLS

Page 13: Intro to Java Technology

Java Tools

• Three platforms: Java SE, Java ME, Java EE• Java SE is used for desktop apps:– Java SE Runtime Environment (JRE)• For running Java apps

– Java SE Development Kit (JDK)• For developing and running Java Apps• Includes JRE!

Page 14: Intro to Java Technology

NetBeans Bundle

• The JDK comes with only the necessary tools to compile and run apps

• The JDK with NetBeans bundle is a IDE (Integrated Development Environment) that has all the tools to create Java SE apps

Page 15: Intro to Java Technology

NetBeans on Mac OS X

Page 16: Intro to Java Technology

Using Text Editor and JDK

• NetBeans is very powerful tool for creating Java Apps

• If you are about to start learning programming, I do not recommend NetBeans, use plain text editor and JDK instead!– NetBeans does a lot work in the background – NetBeans can be sluggish on older computers– NetBeans can be confusing for junior

programmers

Page 17: Intro to Java Technology

Basic JDK Commands (Command Prompt)

• javac – Java Compiler– javac MyProgram.java

• java – Running Java Apps– java MyProgram

• That's it!

Page 18: Intro to Java Technology
Page 19: Intro to Java Technology

NotePad++

• Free text editor indented for programming (Windows)

• Change settings / preferences– New Document: Format: Unix / Windows • Depending on your configuration

– New Document: Encoding: ISO-8859-1– New Document: Default Language: Java– Document: Tab Size 4, [x] Replace by Space

Page 20: Intro to Java Technology

Exercise

• Download and configure Notepad++• Download Java SE 6• Read ...– http://java.sun.com/docs/books/tutorial/

getStarted/cupojava/win32.html

• ... and Compile and run "HelloWorld"-application