JDK, Jan Pettersen Nytun - HiA 1 The Java Programming Environment: The programmer write source code with a text editor. The programmer write source code.

Slides:



Advertisements
Similar presentations
1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
Advertisements

In Review JAVA C++ GUIs - Windows Webopedia.com.
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Lab Information Security Using Java (Review) Lab#0 Omaima Al-Matrafi.
MC697 Object-Oriented Programming Using Java. In this class, we will cover: How the class will be structured Difference between object-oriented programming.
Lab#1 (14/3/1431h) Introduction To java programming cs425
Object Orientated Programming
got ? Research Project – April 1998 Hang Xia, Mark Wang, Richard S. Chang Updated: R Norman, August 1999.
Java: History and Introduction (Lecture # 1). History… Java – Based on C and C++ – Developed in 1991 for intelligent consumer electronic devices – Green.
Lecture 2: Do you speak Java?. From Problem to Program Last Lecture we looked at modeling with objects! Steps to solving a business problem –Investigate.
1 Introduction to Java and Applet Lecture 3 from Chapters 1 and 2 of the complete reference.
1 Introduction to Java and Applet. 2 Download Java Compiler (1)
Lecture 2: Do you speak Java?. From Problem to Program Last Lecture we looked at modeling with objects! Steps to solving a business problem –Investigate.
1-1 Copyright (c) 1999 N. Afshartous Introduction to Java™
JAVA ENVIRONMENT JDK, API, JVM. JAVA ENVIRONMENT  Java environment includes development tools and many classes and methods. Java Environment JDK (Java.
Introduction to Java.
Introduction to the JDK Java for Computational Finance
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
Marlene Galea.  The JDK (Java Development Kit)  An IDE (Integrated Development Environment) ◦ Different IDEs include:  JCreator  NetBeans  BlueJ.
Java Software Solutions Lewis and Loftus Chapter 2 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Software Concepts -- Introduction.
1 CSC 551: Web Programming Spring 2004 Java Overview  Design goals & features  platform independence, portable, secure, simple, object-oriented, … 
Introduction to Java Tonga Institute of Higher Education.
Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code.
CS413: Java Programming language Applications Applets
Introduction to Java Kumar Harshit. Objectives ( 목적지 ) At the end of the lesson, the student should be able to: ● Describe the features of Java technology.
(C) 2010 Pearson Education, Inc. All rights reserved.  Java programs normally go through five phases  edit  compile  load  verify  execute.
 Java Programming Environment  Creating Simple Java Application  Lexical Issues  Java Class Library.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
 2003 Prentice Hall, Inc. All rights reserved. 1 Java Training Course Dr. H.E. Dunsmore Purdue University Java – How to Program, Deitel (5 th Edition)
Session One Introduction. Personal Introduction Role of programmers Robot Examination HUD & HID Uploading Code.
UCSC All rights reserved. No part of this material may be reproduced and sold. 1 IT1202-Fundamentals Of Programming (Using JAVA) Interacting with.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
The Basics of Javadoc Presented By: Wes Toland. Outline  Overview  Background  Environment  Features Javadoc Comment Format Javadoc Program HTML API.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
1.8History of Java Java –Based on C and C++ –Originally developed in early 1991 for intelligent consumer electronic devices Market did not develop, project.
Chapter 13. Applets and HTML HTML Applets Computer Programming with JAVA.
Jaeki Song ISQS6337 JAVA Lecture 03 Introduction to Java -The First Java Application-
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
POS 406 Java Technology And Beginning Java Code
CS266 Software Reverse Engineering (SRE) Reversing and Patching Java Bytecode Teodoro (Ted) Cipresso,
The Joy of Programming (also known as) Introduction to Object-Oriented Programming.
Session 1 Introduction to Java. Objectives Java Simplified / Session 1 / 2 of 32 Explain the history of Java Explain Java in brief List the types of Java.
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
4-Nov-15 Air Force Institute of Technology Electrical and Computer Engineering Object-Oriented Programming Design Topic 1: The Java Environment Maj Joel.
CT1513 Introduction To java © A.AlOsaimi.
23-October-2002cse JavaIntro © 2002 University of Washington1 Intro to Java CSE 413, Autumn 2002 Programming Languages
A compiler is a computer program that translate written code (source code) into another computer language Associated with high level languages A well.
Applets Java code is compiled into byte code instead of machine language –Languages like C, C++, Pascal and others are compiled into machine language so.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
CSI 3125, Preliminaries, page 1 Applet. CSI 3125, Preliminaries, page 2 Applet An applet is a Java program that runs in a Web browser. An applet can be.
Java Programming: Advanced Topics1 Introduction to Advanced Java Programming Chapter 1.
Lecture1 Instructor: Amal Hussain ALshardy. Introduce students to the basics of writing software programs including variables, types, arrays, control.
1 Introduction Read D&D Sec 1.8; Sec 1.13 THE Java tutorial -
Know Your Java. Java is special Java source code Byte code/ native code Object code on windows Object code on Dos Object code on Lynux.
ITP 109 Week 2 Trina Gregory Introduction to Java.
Introduction to Programming 1 1 2Introduction to Java.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 15: Java Basics Fundamentals of Web Programming.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
Introduction to 1. What is Java ? Sun Microsystems Java is a programming language and computing platform first released by Sun Microsystems in The.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
Topic: Difference b/w JDK, JRE, JIT, JVM
CSC 551: Web Programming Spring 2004
(Computer fundamental Lab)
CSC 551: Web Programming Spring 2004
Chap 1. Getting Started Objectives
Chap 4. Programming Fundamentals
Review of Previous Lesson
Outcome of the Lecture Upon completion of this lecture you will be able to understand Fundamentals and Characteristics of Java Language Basic Terminology.
Presentation transcript:

JDK, Jan Pettersen Nytun - HiA 1 The Java Programming Environment: The programmer write source code with a text editor. The programmer write source code with a text editor. One source file for each public class Classe1.java Classe2.java Classe1.class Classe2.class One class file for each class The source code is submitted to a compiler. The compiler translates the source code into Java bytecode. The source code is submitted to a compiler. The compiler translates the source code into Java bytecode. Bytecode is a low level language similar to machine language. compiling to bytecode

JDK, Jan Pettersen Nytun - HiA 2 The Java Programming Environment: executing the code Classe1.class Classe2.class A Java Virtual Machine (JVM) interprets (executes) the bytecode. A JVM is a program which simulates a machine A Java Virtual Machine (JVM) interprets (executes) the bytecode. A JVM is a program which simulates a machine A Java enabled browser contains a JVM. A Java “program” that can run inside a browser is called an applet. It is also possible to make stand-alone applications. The class loader, which is part of the JVM, will load classes as they are needed. Before the bytecode is interpreted it will be inspected by a bytecode verifier. The bytecode verifier will make sure that the bytecode is legal and that it don’t break Java’s security restrictions.

JDK, Jan Pettersen Nytun - HiA 3 The Java Programming Environment: compiling to native code native code compilers There are some native code compilers (compilers that generates code for a particular machine platform) available for Java, but just-in-time (JIT) compilers are more common. just-in-time (JIT) compiler A just-in-time (JIT) compiler will generate native code the first time a class is used, the code is cached for later use. hardware support Some hardware support for bytecode is also available.

JDK, Jan Pettersen Nytun - HiA 4 JDK JDK - Java Development Kit The Java Development Kit contains the software and tools that you need to compile, debug, and run applets and applications that you've written using the Java programming language. JDK is available free from SUN Microsystems, the creators of the Java programming language (

JDK, Jan Pettersen Nytun - HiA 5 the basic command-line tools Some of the basic command-line tools in the Java Development Kit (JDK) javacjavac -Is the Java compiler. Java source code (file with a.java extension) is compiled into Java bytecodes (class file, extension.class). javajava - Is the Java Interpreter, it executes Java class files. jdbjdb - Is a command-line debugger for Java classes. appletviewerappletviewer - Is the Java applet viewer, it allows you to run applets without a web browser. javahjavah - Is used to integrate C and Java. javapjavap - Disassembles class files. javadocjavadoc - Generates documentation from a Java source file.

JDK, Jan Pettersen Nytun - HiA 6 javap - javap - the Java Class Disassembler It is possible to do some reverse engineering from Java bytecode classes. With javap you can get a human-readable version of the specified Java bytecode classes. Usage: javap where options include: -c Print bytecode for each method (disassemble the code). -private Shows all classes, variables, and methods. Usage: javap where options include: -c Print bytecode for each method (disassemble the code). -private Shows all classes, variables, and methods.

JDK, Jan Pettersen Nytun - HiA 7 javap - javap - In the given example the file MenuApplet.class is disassembled C:\Java\myclasses>javap -private MenuApplet Compiled from MenuApplet.java public synchronized class MenuApplet extends java.applet.Applet implements java.awt.event.ActionListener /* ACC_SUPER bit set */ { public MenuApplet(); public void init(); public void actionPerformed(java.awt.event.ActionEvent); private void showPage(java.lang.String); }

JDK, Jan Pettersen Nytun - HiA 8 javadoc javadoc - Generates API documentation in HTML format from Java source code. The documentation describes the class, its inheritance hierarchy, and each nonprivate variable and method in the class. Comments in the source code that begin with /** and end with */ is also included. Each separate line of the comment must start with an *. Special tags placed in the source code are recognized. These doc tags enable you to autogenerate a complete, well- formatted API from your source code. The tags start with an "at" sign

JDK, Jan Pettersen Nytun - HiA 9 javadoc javadoc - Example from a source file /* * MenuApplet.java * Copyright (c) 1998 HiA, All Rights Reserved. */ import java.applet.*; /** * This applet will display two buttons, each leading to a given URL. Jan Pettersen Nytun 1.1, 98/08/13 */ public class MenuApplet extends Applet implements ActionListener { /** * Initialize the applet. void */ public void init() {