Introduction to Drjava

Total Page:16

File Type:pdf, Size:1020Kb

Introduction to Drjava Object Oriented Programming 3rd Semester Computer Engineering LAB 1 (Part II) Introduction to DrJava Objective The main objective of this Lab is to familiarize the students with DrJava. DrJava is a programming environment for Java designed specifically for beginners. Additionally, it is also suitable for advanced program development. To start using DrJava please follow the following steps to make DrJava up and running. Steps 1. Download jdk1.5 from http://java.sun.com/javase/downloads/index_jdk5.jsp A JDK distribution consists of a JRE distribution (a Java Virtual Machine implementation) plus a collection of development tools including javac, a Java compiler, and javadoc, Java documentation generator. DrJava requires a JDK installation because it uses both javac and javadoc as plug-in components. Without these components, DrJava can only edit Java programs; it cannot execute them or generate documentation for them. 2. Download ‘Current stable release’ of Dr Java from the following website and save it locally at an appropriate location. http://www.drjava.org/ 3. Find the file you just downloaded and double-click its icon. The icon looks like this 4. A splash will appear. The splash screen may be quickly replaced by an error message. University of Engineering and Technology Taxila Object Oriented Programming 3rd Semester Computer Engineering If so , Click Yes. A file open dialog will appear. Use it to find the tools.jar file. It should be located in C:\java\jdk1.5\lib\. Click Open. 5. Dr. Java will begin running. University of Engineering and Technology Taxila Object Oriented Programming 3rd Semester Computer Engineering Exploring DrJava Menu Items Before discovering Menu items we must know some conventions. 6. File Menu By clicking file menu you will find options like Open, Save, Save As, Rename, Close, Print etc. University of Engineering and Technology Taxila Object Oriented Programming 3rd Semester Computer Engineering 7. Project Menu By clicking project menu you will find options like New, Open and Save project. 8. Help Menu By Pressing F1 Key on keyboard or by clicking help University of Engineering and Technology Taxila Object Oriented Programming 3rd Semester Computer Engineering Help page will be open where you can find a huge and brief collection of help regarding drjava.If you face any problem you can get help from it. 9. Interaction Pane Allows you to enter and evaluate Java statements and expressions on the fly. This is remarkably useful for beginning students, who no longer have to learn to write main methods, recompile, and run programs from a command line simply to test how a new class or method behaves. Simply define variables and call methods as you would in an ordinary method, or even define new classes and methods and call them interactively. 10. You will find most commonly used items on main screen 11. Compile This button compile the source code in the main window. Run This button runs the compiled program. Reset This button reset the interaction pane. Javadoc It generates the documentation of this program. University of Engineering and Technology Taxila Object Oriented Programming 3rd Semester Computer Engineering 12. For Further Help read ‘Quick start guide’ and ‘Documentation’ from http://www.drjava.org/ References http://drjava.sourceforge.net/devdocs/ http://www.learningwithrobots.com/installDoc/DrJava/DrJava.html http://www.google.com http://drjava.sourceforge.net/userdocs/ University of Engineering and Technology Taxila .
Recommended publications
  • Universidade Salvador – Unifacs Programa De Pós-Graduação Em Redes De Computadores Mestrado Profissional Em Redes De Computadores
    UNIVERSIDADE SALVADOR – UNIFACS PROGRAMA DE PÓS-GRADUAÇÃO EM REDES DE COMPUTADORES MESTRADO PROFISSIONAL EM REDES DE COMPUTADORES DEMIAN LESSA INTERFACES GRÁFICAS COM O USUÁRIO: UMA ABORDAGEM BASEADA EM PADRÕES Salvador 2005 DEMIAN LESSA INTERFACES GRÁFICAS COM O USUÁRIO: UMA ABORDAGEM BASEADA EM PADRÕES Dissertação apresentada ao Mestrado Profissional em Redes de Computadores da Universidade Salvador – UNIFACS, como requisito parcial para obtenção do grau de Mestre. Orientador: Prof. Dr. Manoel Gomes de Mendonça. Salvador 2005 Lessa, Demian Interfaces gráficas com o usuário: uma abordagem baseada em padrões / Demian Lessa. – Salvador, 2005. 202 f.: il. Dissertação apresentada ao Mestrado Profissional em Redes de Computadores da Universidade Salvador – UNIFACS, como requisito parcial para a obtenção do grau de Mestre. Orientador: Prof. Dr. Manoel Gomes de Mendonça. 1. Interfaces gráficas para usuário - Sistema de computador. I. Mendonça, Manoel Gomes de, orient. II. Título. TERMO DE APROVAÇÃO DEMIAN LESSA INTERFACES GRÁFICAS COM O USUÁRIO: UMA ABORDAGEM BASEADA EM PADRÕES Dissertação aprovada como requisito parcial para obtenção do grau de Mestre em em Redes de Computadores da Universidade Salvador – UNIFACS, pela seguinte banca examinadora: Manoel Gomes de Mendonça – Orientador _________________________________ Doutor em Ciência da Computação pela Universidade de Maryland em College Park, Estados Unidos Universidade Salvador - UNIFACS Celso Alberto Saibel Santos ____________________________________________ Doutor em Informatique Fondamentalle et Parallelisme pelo Université Paul Sabatier de Toulouse III, França Universidade Federal da Bahia – UFBA Flávio Morais de Assis Silva _____________________________________________ Doutor em Informática pelo Technische Universität Berlin, Alemanha Universidade Federal da Bahia – UFBA Salvador de de 2005 A meus pais, Luiz e Ines, pelo constante incentivo intelectual e, muito especialmente, por todo amor e carinho repetidamente demonstrados.
    [Show full text]
  • CSCE A201 Computer Programming I Lab 0
    CSCE A201 Computer Programming I Lab 0 Lecture Instructors: Dr. Kenrick Mock, MW 11:30‐12:45pm Dr. Frank Witmer, TR 10‐11:15am Lab Assistants: Deanna Flynn Elisha Waugh Goals for Today • Introduce lab assistants • Meet some of your classmates • Introduction to Dr. Java • Understand platform independence • Write your first (!?) Java program Syllabus Highlights wrt. Lab • May students collaborate on lab assignments? • May students collaborate on programming assignments? • What percentage of the total course grade is determined by lab? • How is the lab grade determined? Introduce your Neighbor 1. Name 2. Hometown 3. Something interesting (e.g. hobby or recent trip) Some Java Development Environments • Dr. Java – from Rice University, simple & effective – standalone executable (installation instructions on Blackboard) • jGRASP – NSF funded at Auburn University • Intellij IDEA – good code completion & error messages – https://www.jetbrains.com/idea/ • NetBeans – from Oracle, good for multiple, larger projects • Eclipse – more plug‐ins, more customizable – good for Android development) • TextPad (initially free, but then ~$30) • Any text editor & command line – Notepad++ with Cygwin/DOS – emacs, vim, nano with unix/linux • See also Appendix 1 in Savitch book Java Example • Class Hello must be stored in file Hello.java public class Hello { public static void main(String[] args) { System.out.println("Hello world."); } } Platform Independence Demo • Compile java & C++ programs on linux – Which executable/bytecode will run on a Windows machine? Platform Independence • Use ‘javac’ command to compile Java source code .java files high‐level language • Use ‘java’ command to run Java bytecode .class and .jar (Java Archive) files low‐level language Same bytecodes can run any platform with an appropriate JVM (‘java’) Lab 0 Exercise 1.
    [Show full text]
  • Java Ide's One-On-One*
    DR. J VS. THE BIRD: JAVA IDE'S ONE-ON-ONE* Michael Olan Computer Science and Information Systems Richard Stockton College Pomona, NJ 08240 609-652-4587 [email protected] ABSTRACT An important decision facing instructors of introductory programming courses is the choice of supporting software development tools. Usually this involves selecting an integrated development environment (IDE). BlueJ has received widespread adoption for first year courses that use the Java programming language; however, DrJava is emerging as an alternative. This paper features a comparison of the pedagogical approaches used by BlueJ and DrJava as a guideline for selecting the tool best suited to the teaching style used in the introductory course. 1. INTRODUCTION The choice was simple when text editors and the command line were the only tools for developing programs. That changed with the introduction of integrated development environments (IDE's), and campuses nationwide adopted Borland's Turbo Pascal. Languages also have changed. Pascal was designed as a teaching language, but now academic programs use advanced languages designed for professional software engineers. Making these complex languages accessible to beginning students requires a careful selection of the development environment. This discussion will only include Java, currently the dominant language choice for introductory courses. Let us first consider several levels of tool support in the introductory course sequence: 1) Minimal: A text editor and the command line. 2) Simple IDE: Just the basics, no bells and whistles. 3) Professional IDE: Powerful and feature filled. ___________________________________________ * Copyright © 2004 by the Consortium for Computing Sciences in Colleges. Permission to copy without fee all or part of this material is granted provided that the copies are not made or distributed for direct commercial advantage, the CCSC copyright notice and the title of the publication and its date appear, and notice is given that copying is by permission of the Consortium for Computing Sciences in Colleges.
    [Show full text]
  • The Impact of Different Teaching Approaches and Languages On
    The Impact of Different Teaching Approaches and Languages on Student Learning of Introductory Programming Concepts A Thesis Submitted to the Faculty of Drexel University by Wanda M. Kunkle in partial fulfillment of the requirements for the degree of Doctor of Philosophy September 2010 Copyright 2010 Wanda M. Kunkle. All Rights Reserved. ii DEDICATIONS I dedicate this dissertation to the memory of Nathan J. Kunkle the loving father who encouraged me to become the person I was meant to be and the highly respected educator who inspired me to follow in his footsteps. Nathan J. Kunkle (1907 – 1965) iii ACKNOWLEDGEMENTS I wish to thank my advisor, Robert Allen, and the members of my dissertation committee for their support and guidance in doing the research and writing required to complete this work. I also wish to thank the Computer Science instructors who helped me recruit the students who participated in my research study, as well as the students themselves. Without the students, there would have been no study. I especially wish to thank the friends and family who encouraged me to keep going when I began to falter because I was feeling overwhelmed by the amount of time and effort I needed to put in to complete this dissertation. Some of those friends are on my dissertation committee, so they are getting thanked twice. Finally, a special thanks goes out to my cousin, Durand Kunkle, who regularly called to ask how I was progressing with my dissertation. He has been planning the celebration for some time now. iv TABLE OF CONTENTS LIST OF FIGURES
    [Show full text]
  • Introduction to Algorithms in Java
    Algorithms in Java: Shuffling and Random Numbers Algorithms Introduction Itʹs impossible to study programming – or even talk in depth about it – without talking about algorithms. Theyʹre an essential part of programming. Fortunately, all of us – programmers and non‐programmers alike – have experience with algorithms. Every time you give someone driving directions; every time you use a recipe to cook; every time you follow instructions for using a piece of software – all of these activities (and countless others) involve algorithms. So what is an algorithm? Simply put, an algorithm is a set of instructions, intended to solve a specific problem or accomplish a specific, finite goal, in a direct fashion. What Makes an Effective Algorithm? In general, ambiguity doesnʹt make for a good algorithm; this is particularly true in programming, because computers are mostly incapable of knowing what we want them to do, unless we spell it out precisely. So the algorithms we use should also be precise – even before we translate them into a programming language. An effective algorithm usually has the following characteristics: • Clear conditions of application: What task is the algorithm intended to accomplish, and what are the requirements for us to be able to use it? • Initialization steps & starting conditions: What do we do to prepare our data for the algorithm? How can we tell if weʹre ready to proceed? • Explicit stopping conditions and states: How do we know when weʹre done? How do we know whether we met the desired goal? • Unambiguous steps that lead from the starting conditions to the stopping conditions. Note that “unambiguous” is a subjective term.
    [Show full text]
  • 1 Play with Drjava & and the Scanner Class
    CS100M Lab Exercise 8 1 Play with DrJava & and the Scanner class The programming environment that we are going to use is called DrJava. It provides both the abilities to execute a program and to work interactively with the system. In Java, getting input from users requires the use of an object. We’ll talk much more about objects and classes later, but for now you will just get some experience with using an object from the Scanner class to getting keyboard input. 1.1 Compiling and running a program 1. Download from the Lecture Materials page the file Earth.java under the March 13 lecture. Save it to a directory of your choice, e.g., the Desktop. Now start up DrJava and open the file Earth.java. Read the code to make sure you understand it. Have you noticed that you can use a printf method for printing? printf behaves just like fprintf from Matlab. Compile the file (click Compile All) and then run it (select Tools—Run Document’s main Method). 2. Change the print statement to use the println method. (You cannot control the number of decimal places here.) Compile and run the program again. 3. Now change the program to accept user input from the keyboard. Remove the statement that declares variable r and assigns a value to it. You will need an object from the Scanner class to read input. The following statement will create such an object and call it keyboard: Scanner keyboard= new Scanner(System.in); You will learn why the statement looks like this later, but for now simply use the statement.
    [Show full text]
  • A Friendly Face for Eclipse
    A Friendly Face for Eclipse Charles Reis Robert Cartwright Rice University Rice University 6100 S. Main St. 6100 S. Main St. Houston TX 77005 Houston TX 77005 [email protected] [email protected] Abstract and the compile/execute command line interface are complex and intimidating for students with little pro- Eclipse is a powerful integrated development environ- gramming experience. Students who are forced to learn ment (IDE) for Java1 targeted at professional software Java using a conventional text editor and command line developers. However, Eclipse is poorly suited for use execution interface are often overwhelmed by the me- in introductory computing education because the com- chanics of writing and running a program and have diffi- plexity of its interface and the associated computing en- culty focusing on learning how to design object-oriented vironment can overwhelm beginners. In contrast, Dr- programs. For these reasons, many instructors elect to Java is a friendly, highly interactive IDE targeted at use an integrated development environment (IDE) for teaching Java to beginners. DrJava has a simple inter- Java in an effort to relieve students of some of the cler- face consisting of a Definitions pane for entering and ical burdens involved in writing Java programs. editing program text and an Interactions pane for eval- uating arbitrary Java statements and expressions given 2 IDEs in the Classroom the program in the Definitions pane. This interface frees students from the complication of defining main In the context of computing education, there are sev- methods for their programs and encourages them to eral fundamental requirements that an IDE must sat- explore the Java language by conducting simple exper- isfy.
    [Show full text]
  • Computer-Science.Pdf
    Computer Science 1 A coordinated MBA/MCS degrees program is also offered in conjunction COMPUTER SCIENCE with the Jesse H. Jones Graduate School of Business. Contact Information Bachelor's Programs Computer Science • Bachelor of Arts (BA) Degree with a Major in Computer Science https://www.cs.rice.edu/ (https://ga.rice.edu/programs-study/departments-programs/ 3122 Duncan Hall engineering/computer-science/computer-science-ba/) 713-348-4834 • Bachelor of Science in Computer Science (BSCS) Degree (https:// ga.rice.edu/programs-study/departments-programs/engineering/ Christopher M. Jermaine computer-science/computer-science-bscs/) Department Chair [email protected] Master's Programs Alan L. Cox • Master of Computer Science (MCS) Degree (https://ga.rice.edu/ Undergraduate Committee Chair programs-study/departments-programs/engineering/computer- [email protected] science/computer-science-mcs/) • Master of Computer Science (MCS) Degree, Online Program (https:// T. S. Eugene Ng ga.rice.edu/programs-study/departments-programs/engineering/ Graduate Committee Chair computer-science/computer-science-mcs-online/) [email protected] • Master of Data Science (MDS) Degree (https://ga.rice.edu/programs- study/departments-programs/engineering/data-science/data- science-mds/) Computer science is concerned with the study of computers and • Master of Data Science (MDS) Degree, Online Program (https:// computing, focusing on algorithms, programs and programming, and ga.rice.edu/programs-study/departments-programs/engineering/ computational systems. The main goal of the discipline is to build a data-science/data-science-mds-online/) systematic body of knowledge, theories, and models that explain the • Master of Science (MS) Degree in the field of Computer Science properties of computational systems and to show how this body of (https://ga.rice.edu/programs-study/departments-programs/ knowledge can be used to produce solutions to real-world computational engineering/computer-science/computer-science-ms/) problems.
    [Show full text]
  • Java Beyond Drjava Announcements for This Lecture
    Lecture 25 Java Beyond DrJava Announcements for This Lecture This Week Next Week • Reading: Chapter 16 • Submit a course evaluation • Assignment A6 graded . Will get an e-mail for this . Mean: 86.8, Median: 90 . Part of the “participation . Mean: 10.5h, Median: 10h grade” (e.g. clicker grade) th • No new lab this week • Final, May 10 9:00-11:30 . Review posted later this week . Turn in lab from last week . Work on assignment A7 • Conflict with Final Exam? . e.g. > 2 finals in 24 hours • Assignment A7 due Saturday . Submit conflicts on CMS Announcements for This Lecture This Week Next Week • Reading: Chapter 16 • SubmitReview asessions course nextevaluation week • Assignment A6 graded . WillStill lining get an up e-mail times for this . Mean: 86.8, Median: 90 . Part3 sessions/day of the “participation in 1 hour slots . Mean: 10.5h, Median: 10h . Monday,grade” (e.g. Tuesday clicker 1-4 grade) . Either Sundayth or Wednesday • No new lab this week • Final, May 10 9:00-11:30 • Topics. Review posted posted Thursday later this week . Turn in lab from last week . Work on assignment A7 • Conflict with Final Exam? . e.g. > 2 finals in 24 hours • Assignment A7 due Saturday . Submit conflicts on CMS Steganography Observation message • Most you preferred end /** terminates markers to using length … • But few cons to length * Format: ## message ## . Only requires two pixels" */ (e.g. <= 999,999) public ImageProcessor { . Hard part: conversion … • Markers okay if not printable } . Non-printable chars: <= 32 . Or 3-digits numbers > 255 • Bad if marker is in message Tried to “hide” your source code .
    [Show full text]
  • Introduc{On to Java, Etc
    Introduc)on to Java, etc. August 2012 Connec)ng to the class server • Class server : bio5495-work.wustl.edu • Username = first ini)al last name for eg : aeinstein • Password = <username>123 for eg : aeinstein123 • Mac Users : Applicaons àUli)es à Terminal ssh [email protected] • Windows Users : ssh client like PuTTy/ WinSCP Hostname = bio5495-work.wustl.edu (Last year the class server was Warlord, incase you no)ce it in the notes, read as class server) SSH and SFTP • Login : use secure shell – ssh [email protected] • Transfer files : use secure file transfer protocol – sp [email protected] Quick Unix Overview ls list files ls -l list files (long format) ls –a list all files (hidden too) man (command) help cd change directory mkdir make directory cp source folder copy source to folder mv source folder mover source to folder rm filename remove filename rmdir folder remove empty directory rm -rf folder remove directory and all its contents Need more? Search ‘unix commands cheat sheet’ Sp commands • cd folder: change current locaon to folder on the server • lcd folder :change current locaon to folder on the local machine • ls : list files in the current folder on the server • lls : list files in the current folder on the local machine • Once you are in the correct folders on both ends : – get file : download a file (accepts wildcards like "*") – put file : upload a file (accepts wildcards like "*") Java Development Environment • IDE (Integrated Development Environment) – Eclipse • hp://www.eclipse.org/downloads/
    [Show full text]
  • Using Drjava
    Technical Note No. 106 Using DrJava Published: January 4, 2008. Last reviewed on October 22, 2016 By Daryl Close, Professor of Computer Science and Philosophy, Heidelberg University, Tiffin, Ohio Summary: This note provides instructions on using the DrJava IDE. Downloading and Configuring DrJava 1. What is DrJava? DrJava is a lightweight, open source Java IDE (integrated development environment) described as a “development environment . designed primarily for students,” but with “powerful features for more advanced users” (http://www.drjava.org/). A unique feature of DrJava is the Interactions Pane, an interpreter-based pane that allows the programmer to test code snippets without writing a main method. Sun Microsystems (now owned by Oracle) is involved in funding the DrJava project, along with other open source Java IDEs such as BlueJ, Eclipse, and Sun’s own NetBeans. 2. Downloading DrJava If DrJava is required software in your CPS course, you will want to download and install the most recent DrJava version to your own machine and USB drive from http://www.drjava.org. At this writing, the current stable release is drjava-beta-20160913-225446. I recommend using the “Jar File” rather than the “Windows App.” Either one will work fine simply by clicking the file after downloading, but I have encountered compiler problems with the Windows App version on some machines. Neither download needs to be extracted in order to execute the program although you may right-click and extract the extra files if you like. The download file is about 6 MB and can be easily stored on a USB flash drive.
    [Show full text]
  • Drjava User Documentation Drjava User Documentation Table of Contents
    DrJava User Documentation DrJava User Documentation Table of Contents 1. Introduction ................................................................................................................... 1 2. Getting Started ............................................................................................................... 2 Philosophy ................................................................................................................ 2 Downloading DrJava ................................................................................................... 2 Running DrJava ......................................................................................................... 2 System Requirements .................................................................................................. 3 License ..................................................................................................................... 3 3. Editing Programs ............................................................................................................ 5 Definitions Pane ......................................................................................................... 5 Multiple Documents .................................................................................................... 6 Source Navigation ...................................................................................................... 7 Predictive Input Dialogs .............................................................................................
    [Show full text]