Introduction to IntelliJ

Similar documents
SDKs - Eclipse. SENG 403, Tutorial 2

Intro to MS Visual C++ Debugging

Supplement: Visual C++ Debugging

Supplement H.1: JBuilder X Tutorial. For Introduction to Java Programming, 5E By Y. Daniel Liang

NetBeans Tutorial. For Introduction to Java Programming By Y. Daniel Liang. This tutorial applies to NetBeans 6, 7, or a higher version.

Eclipse Tutorial. For Introduction to Java Programming By Y. Daniel Liang

Debugging in Small Basic is the process of analysing a program to detect and fix errors or improve functionality in some way.

The NetBeans Debugger: A Brief Tutorial

Supplement II.B(1): JBuilder X Tutorial. For Introduction to Java Programming By Y. Daniel Liang

2 Getting Started. Getting Started (v1.8.6) 3/5/2007

with TestComplete 12 Desktop, Web, and Mobile Testing Tutorials

1. Move your mouse to the location you wish text to appear in the document. 2. Click the mouse. The insertion point appears.

Outline. Debugging. In Class Exercise Solution. Review If Else If. Immediate Program Errors. Function Test Example

Word Track Changes

Laboratory Assignment #4 Debugging in Eclipse CDT 1

Programming Logic - Beginning

Getting Started (1.8.7) 9/2/2009

GETTING STARTED WITH ECLIPSE Caitrin Armstrong

Visual Studio.NET. Rex Jaeschke

JCreator. Starting JCreator

1 Introduction to MARS

CS 201 Software Development Methods Spring Tutorial #1. Eclipse

ECE QNX Real-time Lab

The NetBeans IDE is a big file --- a minimum of around 30 MB. After you have downloaded the file, simply execute the file to install the software.

Code::Blocks Student Manual

IDE: Integrated Development Environment

Code::Blocks Student Manual

NetBeans IDE Field Guide

7 The Integrated Debugger

Simulator. Chapter 4 Tutorial: The SDL

Say you want a new blank document, just like the one Word shows you when you start the program. No problem here are the steps:

ActiveSpaces Transactions. Quick Start Guide. Software Release Published May 25, 2015

Introduction. Key features and lab exercises to familiarize new users to the Visual environment

Visual Studio.NET. Although it is possible to program.net using only the command OVERVIEW OF VISUAL STUDIO.NET

Ink2Go Help. Toolbar functions

At the shell prompt, enter idlde

Parallel Debugging. ª Objective. ª Contents. ª Learn the basics of debugging parallel programs

Getting Started with Visual Studio

Introduction to Computation and Problem Solving

IBM ILOG OPL IDE Reference

Introduction. Getting to Know Word The Ribbon. Word 2010 Getting Started with Word. Video: Exploring Your Word 2010 Environment.

EXECUTION OF METHODS

Since you can designate as many symbols as needed as baseline symbols it s possible to show multiple baselines with unique symbology.

LabVIEW. Table of Contents. Lesson 1. Pre-reqs/Technical Skills Basic computer use

Mend for Eclipse quick start guide local analysis

Welcome to the Trinity Parent Portal!

HOW TO USE CODE::BLOCKS IDE FOR COMPUTER PROGRAMMING LABORATORY SESSIONS

Lab # 2. For today s lab:

CPE 323: Laboratory Assignment #1 Getting Started with the MSP430 IAR Embedded Workbench

We first learn one useful option of gcc. Copy the following C source file to your

Hello, welcome to this brief tutorial on accessing and playing Adobe Presenter video files.

Enterprise Architect. User Guide Series. Portals. Author: Sparx Systems. Date: 19/03/2018. Version: 1.0 CREATED WITH

Deleting Reports and Dashboards

Debugging. CSE 2231 Supplement A Annatala Wolf

Chapter 12 Visual Program Debugger

CHAPTER 1. Interface Overview 3 CHAPTER 2. Menus 17 CHAPTER 3. Toolbars and Tools 33 CHAPTER 4. Timelines and Screens 61 CHAPTER 5.

Enterprise Architect. User Guide Series. Portals

Enterprise Architect. User Guide Series. Profiling

Enterprise Architect. User Guide Series. Profiling. Author: Sparx Systems. Date: 10/05/2018. Version: 1.0 CREATED WITH

2 The Stata user interface

Lab 8 - Vectors, and Debugging. Directions

Enterprise Architect. User Guide Series. Portals

QNX Software Development Platform 6.6. Quickstart Guide

Introduction. Format Text. Word 2010 Formatting Text. To Change the Font Size: Page 1

BasicScript 2.25 User s Guide. May 29, 1996

Lab Exercise 1 Using EGit and JUnit

An Introduction to Komodo

IBM VisualAge for Java,Version3.5. Distributed Debugger for Workstations

Moving graphic examples are included on some pages. To view them you need the Flash plugin on your

Handout Objectives: a. b. c. d. 3. a. b. c. d. e a. b. 6. a. b. c. d. Overview:

Under the Debug menu, there are two menu items for executing your code: the Start (F5) option and the

1.00 Lecture 2. What s an IDE?

Integrated Software Environment. Part 2

Optional Eclipse Workspace Configurations

Lab 0 Introduction to the MSP430F5529 Launchpad-based Lab Board and Code Composer Studio

VB Net Debugging (Console)

Prerequisites for Eclipse

Introduction. Rehearse and Record Slide Shows. Advanced Presentation Options. Rehearsing Slide Show Timings. Page 1

If this is the first time you have run SSMS, I recommend setting up the startup options so that the environment is set up the way you want it.

Application Development in ios 7

ADT: Eclipse development tools for ATL

MEDIA COMPUTATION DRJAVA. Lecture 11.3 November 7, 2008

Application Tutorial

A Tour of the Scripting System. Contents

BASICS OF THE RENESAS SYNERGY PLATFORM

COMPUWARE TEST DRIVE TOPAZ WORKBENCH WORKSHOP. Automated Unit Testing

IBM i Debugger. Overview Service Entry Points Debugger Functions Attach to an IBM i Job Launch Configurations and Settings

After completing this appendix, you will be able to:

3. Hello World! for IDEA. Java. Summer 2008 Instructor: Dr. Masoud Yaghini

Debugging INTRODUCTION DEBUGGER WHAT IS VBA'S DEBUGGING ENVIRONMENT?

CSE 101 Introduction to Computers Development / Tutorial / Lab Environment Setup

Managing Files & Folders

In the first class, you'll learn how to create a simple single-view app, following a 3-step process:

Watch the video below to learn more about formatting text in Word. *Video removed from printing pages. To change the font size:

Chapter 1: Getting Started

Required Setup for 32-bit Applications

Java Resources. CSC2007 Code Repository (including NetBeans and Java 7 setup)

Introduction to Microsoft Word

Sun ONE Integrated Development Environment

WELCOME TO KIN (KIRKWOOD INFORMATION NETWORK) Initial steps to set up KIN on your computer.

Transcription:

Introduction to IntelliJ IntelliJ is a large software package used by professional software developers. This document will give you a brief introduction but is by no means exhaustive. If you have questions after working through this material, please ask in lab, DLC or office hours. The screenshots used in this tutorial are from a project named SpaceInvadersBase but note that this is just an example. It is not necessary to be working with this particular project. Terminology When you first open IntelliJ, you will either see the Welcome dialog or the last project that you had opened. If a project is open and you want to return to the Welcome dialog, just close the project (File -> Close Project). When you first checkout a project from the repository, you will likely be presented with an empty view:

You'll probably want to start by opening the Project View. Note that the instructions for doing this appear in the middle of the screen. After opening the Project View, IntelliJ will look as follows: The Project View enables you to access all the files associated with your project, including IntelliJ configuration files, which aren't usually of interest. The Packages view exposes only the Java packages and source files, and is often more convenient. To access the Packages view, click the down-arrow in the Project view tab and select Packages.

To open a file, expand the packages, if necessary, by clicking the triangle to the left of the package and then double-click the file to open it in an editor window: Writing, running and debugging Java code Scheme and BSL are interpreted languages. The interpreter parses the code and executes the instructions immediately. Java is a compiled language. The compiler parses the code, compiles it to Java bytecode and saves it to be run later by the JVM (Java Virtual Machine). By default, IntelliJ will recompile your code whenever you try to run it. It will also warn you right away if any of the code that you type contains a syntax error. When you write code, you are working on a file. The code is not actually running! When you debug code, you are exploring code that is actually running. In other words, IntelliJ is running the executable file and allowing you to observe what's happening while it's running. The debugger can therefore help you figure out what's happening when the code runs. Without the debugger, figuring out what happens when the code runs can be much more difficult. In other words, investing some time in learning how to use the debugger will really pay off in the long run.

Techniques for understanding code 1. Run the application. This can help you to understand the purpose of the application. To run an application, you must right-click on a particular class in the Packages view and choose Run SomeClass.main() where SomeClass is the name of the class. At the start of the course, we will always tell you which class you must select. In the case of the SpaceInvadersBase application illustrated in this tutorial, it is the SpaceInvaders class in the ui package. Having run the application once, you can easily run it again using the Run icon on the toolbar: 2. Extract models from the code, to help you understand what it does. As we go through the course, we will illustrate various techniques for extracting models from Java code. 3. Run the code using the debugger. Use breakpoints, check the value of variables, step through the code and look at the call stack. To run code in the debugger, right-click the same class that you would select if you were to run the code and select Debug SomeClass.main(). Having run the application using the debugger once, you can easily do it again using the Debug button on the toolbar: Debugging Tools Breakpoints the debugger will pause execution when it encounters a breakpoint. This will allow you to explore specific execution paths as the code runs. To set a breakpoint, click in the margin to the left of the code. A red dot will appear and the line will be highlighted in red:

Check the value of variables you can see the current value of variables in the Variables view. Step through the code once you've stopped at a breakpoint, you'll likely want to run the code step-by-step. You can step through the code one line at a time in order to see what happens when each line is executed. You will see the following buttons in the toolbar of the Debug view. Hover your mouse over each of them to get a hint as to their purpose: IntelliJ 14: IntelliJ 15: Show Execution Point will highlight the statement at which the debugger has paused in an editor window Step Over will execute the current statement. If that statement contains a method call, it will not step into that method. Step Into will execute the current statement. If that statement contains a method call, it will move into that method (unless the method is in the Java library). Force Step Into will execute the current statement. If that statement contains a method call, it will move into that method (even when method is in the Java library). Step Out will execute the rest of the current method, return from it, and then pause at the next statement to be executed. Drop Frame steps back out of the current method to the point from where it was called. Run To Cursor runs the code to the statement at which the cursor has been positioned. Evaluate Expression evaluate an expression that you specify based on the current value of variables.

Call Stack the call stack provides information about the currently active methods. You may wish to click the filter button so that you see only the methods in the code that you've written and hide calls to methods in the Java library. In the example shown above, actionperformed called update, which called moveinvaders, which called move. Controlling the Debugger the toolbar on the left side of the Debug view allows more coarse-grained control over the debugger. The first four Rerun, Resume, Pause and Stop are particularly useful. Hover your mouse over each button so you figure out which one is which. The Show Breakpoints button opens up a dialog that shows you the breakpoints that have been set in your code. You can use this dialog to temporarily disable certain breakpoints. The Mute Breakpoints button temporarily disables all breakpoints in your project.