Computers as an Expressive Medium Lab 8: jar signing, debugging Mayhew Seavey.

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

Coding and Debugging. Requirements and Specification Recall the four steps of problem solving: Orient, Plan, Execute, Test Before you start the implementation.
GPS and MapView. First In the emulator, set the time zone to something (e.g., east coast) and check that the time is correct. Otherwise, the gps emulator.
Getting Started on VAPPS It’s a little like playing Russian roulette
1 Configuring Internet- related services (April 22, 2015) © Abdou Illia, Spring 2015.
Rachelle Howell The University of Texas at Austin.
Final Thoughts. When you get data… Check for Viruses Lock the files – Right click> properties>click on read only Assume the data has not been cleaned.
Nov 10, Fall 2006IAT 8001 Debugging. Nov 10, Fall 2006IAT 8002 How do I know my program is broken?  Compiler Errors –easy to fix!  Runtime Exceptions.
1 Configuring Web services (Week 15, Monday 4/17/2006) © Abdou Illia, Spring 2006.
Java Network Launch Protocol (JNLP) Tomas Bober. What it is A clever way to manage the contents of your java applications on a client’s computer. If you.
Certificates By Purvi Shah. What is a Certificate A certificate is basically a digitally signed statement from one entity (person, company, etc.), saying.
Introduction to Java A lab course by Dr. Junaid Ahmed Zubairi SUNY Fredonia.
CASE STUDY: Applet Development with GUI and Client-side File Input Arkadiusz Edward Komenda.
Secure Sockets SSL/TLS ICW: Lecture 6 Tom Chothia.
2012 •••••••••••••••••••••••••••••••••• Summer WorkShop Mostafa Badr
Amazon EC2 Quick Start adapted from EC2_GetStarted.html.
Exceptions. Many problems in code are handled when the code is compiled, but not all Some are impossible to catch before the program is run  Must run.
Getting started with Eclipse By Alexander Butyaev.
Getting Started with Eclipse Sandeep Pasuparthy. What’s Eclipse? It is a free software / open source platform- independent software framework for delivering.
Every week: Sign in at the door If you are new: Fill in Registration Form Ask a Mentor how to get started Make sure you are on the Athenry Parents/Kids.
1 Lecture 5 George Koutsogiannakis/ Summer 2011 CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES.
Cosc 5/4730 Sign, convert, and install Android files on Blackberry Playbook.
Source code indexer. What does it do?  Indexes source code for fast lookups of methods, variables, structs, macros, …  But LXR does this… Ctags can.
Installing and Configuring Tomcat A quick guide to getting things set up on Windows.
Java How to Program, 9/e © Copyright by Pearson Education, Inc. All Rights Reserved.
Java Programming, 3e Concepts and Techniques Chapter 2 - Part 2 Creating a Java Application and Applet.
Jun 16, 2014IAT 2651 Debugging. Dialectical Materialism  Dialectical materialism is a strand of Marxism, synthesizing Hegel's dialectics, which proposes.
PARSING FACEBOOK DATA FOR ANDROID 1. Step by Step  Import Android SDK  Get the hash key  Create a new app  Create a new project in Eclipse 
CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES LECTURE 5_1 George Koutsogiannakis/ Summer
Ext Environment Copyright © 2005 Liferay, LLC All Rights Reserved. No material may be reproduced electronically or in print without written permission.
1 Introduction to Applets. 2 Applications Programs that execute using the java interpreter Executes in command windows.
Open your web browser and navigate to protechra.webex.com Open your web browser and navigate to protechra.webex.com.
POS 406 Java Technology And Beginning Java Code
TC 310 The Computer in Technical Communication Dr. Jennifer Turns Week 4, Day 2 (4/23)
Downloading and Installing Autodesk Revit 2016
Deployment via jars and Webstart. How do we distribute our application? Lab says you need to submit CD Lab says you need to submit CD Limitations of CD.
JAVA SECURITY BASIC NETWORKING MULTITHREATING Deniz HASTORUN
HTML Concepts and Techniques Fifth Edition Chapter 6 Using Frames in a Web Site.
9/2/ CS171 -Math & Computer Science Department at Emory University.
LEARNING HTML PowerPoint #1 Cyrus Saadat, Webmaster.
Downloading and Installing Autodesk Inventor Professional 2015 This is a 4 step process 1.Register with the Autodesk Student Community 2.Downloading the.
Lec 16 Adding Mouse and KeyEvent handlers to an Applet Class.
12-2 Chapter Topics Chapter 14 discusses the following main topics: Introduction to Applets A Brief Introduction to HTML Creating Applets with Swing Using.
Csci5931 Web Security1 Java Security Model (GS: Ch. 7)
Creating Applets. What is an applet? What is an applet? A Java program that runs in a web browser. A Java program that runs in a web browser. An applet.
Student Experience It’s your education Type the web site address into the browser given to you by your junior high or high school Select “I am a student”
Advanced Stuff Learning by example: Responding to the mouse.
Java Security Session 19. Java Security / 2 of 23 Objectives Discuss Java cryptography Explain the Java Security Model Discuss each of the components.
TIBCO BusinessWorks.  Generating the key   You will have to create a certificate as you own the server.  The ‘Keytool’ is a utility provided in the.
Getting Started Introduction Section 0 Lecture 1 Slide 1 Section 0 Slide 1 INTRODUCTION TO Modern Physics PHYX 2710 Fall 2004 Intermediate Lab Fall.
MySQL Getting Started BCIS 3680 Enterprise Programming.
CIS Intro to JAVA Lecture Notes Set July-05 GUI Programming –TextField Action Listeners, JEditorPane action listeners, HTML in a JEditorPane,
1 Installing Java on Your PC. Installing Java To develop Java programs on your PC: Install JDK (Java Development Kit) Add the directory where JDK was.
CS12230 Introduction to Programming Lecture 6-2 –Errors and Exceptions 1.
Packages. Access Specifications Public Available anywhere (public keyword) Only one public class per file allowed Protected Available in subclasses, and.
1 Project 7: Looping. Project 7 For this project you will produce two Java programs. The requirements for each program will be described separately on.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Processing  Install Processing  Learn how to edit, run, save, export,
Today's Ninja Challenge: Write Your First Computer Game!
Validation. What is Validation? Removing errors improves the consistency of how our pages look to a wide variety of browsers and devices. Ensuring that.
LAB#8 PKI & DIGITAL CERTIFICATE CPIT 425. Public Key Infrastructure PKI 2  Public key infrastructure is the term used to describe the laws, policies,
Introduction to Exceptions in Java CS201, SW Development Methods.
Editing and Debugging Mumps with VistA and the Eclipse IDE Joel L. Ivey, Ph.D. Dept. of Veteran Affairs OI&T, Veterans Health IT Infrastructure & Security.
Computation as an Expressive Medium Lab 9: Java Mode, External Code, and.JAR signing Jason Alderman.
Data Virtualization Tutorial… SSL with CIS Web Data Sources
Chapter 23 Applets and Java Web Start
Outline Install Java Change Security Files in Java
Creating and Modifying Text part 2
How to Run a Java Program
How to Run a Java Program
Final Thoughts.
Presentation transcript:

Computers as an Expressive Medium Lab 8: jar signing, debugging Mayhew Seavey

This week’s episode: jar signing – Not just for pottery celebrities anymore. jar signing – Not just for pottery celebrities anymore. Debugging – Not just for exterminators anymore. Debugging – Not just for exterminators anymore.

This week’s episode: jar signing – Not just for pottery celebrities anymore. jar signing – Not just for pottery celebrities anymore. Debugging – Not just for exterminators anymore. Debugging – Not just for exterminators anymore. And MORE crappy puns! And MORE crappy puns!

Using Web crawling on Courseware Processing window extends BApplet. You can view Applets on the web, which is why they work (usually) seamlessly with the Courseware. Processing window extends BApplet. You can view Applets on the web, which is why they work (usually) seamlessly with the Courseware. HOWEVER, browsers have security problems when a Java applet tries to access other files at different sites. HOWEVER, browsers have security problems when a Java applet tries to access other files at different sites.

Using Web crawling on Courseware For instance, this call works both in Processing and on the Courseware (provided image1.jpg is in your data directory): For instance, this call works both in Processing and on the Courseware (provided image1.jpg is in your data directory): BImage im = loadImage(“image1.jpg”); BImage im = loadImage(“image1.jpg”); But this call works only in the Processing program, not online: But this call works only in the Processing program, not online: BImage im = loadImage(“ BImage im = loadImage(“

Signing your jar file To allow browsers to control the security of your applet, you must sign it first. To allow browsers to control the security of your applet, you must sign it first. Two steps: Two steps: Create a keystore file. Create a keystore file. Sign your jar file. Sign your jar file. Before you can do this, you must either: Before you can do this, you must either: upload your jar file to your Steel account. upload your jar file to your Steel account. For the following commands, use a shell prompt. For the following commands, use a shell prompt. install the Java SDK on your machine. install the Java SDK on your machine. get to a command line in the directory of your jar. get to a command line in the directory of your jar.

Signing your jar file Create a keystore file. Run the following command: Create a keystore file. Run the following command: keytool -genkey -alias -keystore keytool -genkey -alias -keystore The “-keystore ” part is optional. It allows you to specify where the.keystore file will go. If you don’t specify, it will place it in your default system path. This should be fine for most applications. The “-keystore ” part is optional. It allows you to specify where the.keystore file will go. If you don’t specify, it will place it in your default system path. This should be fine for most applications.

Signing your jar file After you run keytool, it will prompt you for some things: After you run keytool, it will prompt you for some things: keystore password: this is used when signing your jars. keystore password: this is used when signing your jars. Name, Organizational Unit, blah blah: not very important, just provides viewers information on who they’re trusting. Name, Organizational Unit, blah blah: not very important, just provides viewers information on who they’re trusting. key password: also used when signing your jars. Not a problem to make it the same as the keystore password. key password: also used when signing your jars. Not a problem to make it the same as the keystore password.

Signing your jar file Sign your jar file. Run the following command: Sign your jar file. Run the following command: jarsigner -keystore jarsigner -keystore is just the file name of the jar. is just the file name of the jar. just needs to match the alias you used for the keystore. just needs to match the alias you used for the keystore. -keystore is also optional. The default will be the same location as keytool. -keystore is also optional. The default will be the same location as keytool. You will be prompted for your keystore password. You will be prompted for your keystore password.

Viewing the jar file The jar file is signed! Upload it to the courseware like you would normally. The jar file is signed! Upload it to the courseware like you would normally. When anyone loads the applet, a window will come up asking if they accept the certificate. Just click “Yes”, and the applet will load. When anyone loads the applet, a window will come up asking if they accept the certificate. Just click “Yes”, and the applet will load.

Debugging Stack Trace: The indecipherable lines of red that pop up when an error occurs. Stack Trace: The indecipherable lines of red that pop up when an error occurs. This shows what methods were running in what classes when the program broke, as well as the line numbers in their java files. This shows what methods were running in what classes when the program broke, as well as the line numbers in their java files.

Debugging Common errors, and what they mean: Common errors, and what they mean: ArrayOutOfBoundsException ArrayOutOfBoundsException You are trying to access an index in an array that doesn’t have that index. For example, thisArray[-1] or thisArray[6] in an array with length 6 (max index of 5). Check to make sure any for loops have the right conditions. You are trying to access an index in an array that doesn’t have that index. For example, thisArray[-1] or thisArray[6] in an array with length 6 (max index of 5). Check to make sure any for loops have the right conditions.

Debugging Common errors, and what they mean: Common errors, and what they mean: NullPointerException NullPointerException You are trying to access an object that hasn’t been initialized, or is set to null. Remember that in addition to declaring a variable (telling the program this variable exists, has this type, and this name), you must initialize the variable (give it a value or point it at an object). You are trying to access an object that hasn’t been initialized, or is set to null. Remember that in addition to declaring a variable (telling the program this variable exists, has this type, and this name), you must initialize the variable (give it a value or point it at an object). String myString; // declares String variable. String myString; // declares String variable. myString = new String(); // sets variable to point to a String object. myString = new String(); // sets variable to point to a String object.

Debugging Tips Split up tasks into smaller methods. Processing will tell you which method the error occurred in, so the smaller they are, the closer you can pinpoint it. Split up tasks into smaller methods. Processing will tell you which method the error occurred in, so the smaller they are, the closer you can pinpoint it. Processing also gives you a line number. Not as useful when it doesn’t give you a way to scroll to that line, but you can copy and paste your code into another editor (NetBeans, even Dreamweaver) that does have a “go to line” function. Processing also gives you a line number. Not as useful when it doesn’t give you a way to scroll to that line, but you can copy and paste your code into another editor (NetBeans, even Dreamweaver) that does have a “go to line” function.

Debugging Tips Use “println” intelligently to try and figure out what’s wrong. You can use this to keep track of what variables are at different points in the program, or even just to tell you what methods the program is going into. Doing this can help give a sense as to the flow of what is happening in the program. Use “println” intelligently to try and figure out what’s wrong. You can use this to keep track of what variables are at different points in the program, or even just to tell you what methods the program is going into. Doing this can help give a sense as to the flow of what is happening in the program.

End of Slides Let’s do some more hands-on debugging stuff. Let’s do some more hands-on debugging stuff. Betcha thought it’d be a Farscape picture this week, huh? Betcha thought it’d be a Farscape picture this week, huh?

End of Slides Let’s do some more hands-on debugging stuff. Let’s do some more hands-on debugging stuff. Betcha thought it’d be a Farscape picture this week, huh? Betcha thought it’d be a Farscape picture this week, huh?