Presentation is loading. Please wait.

Presentation is loading. Please wait.

Development Environment Basics

Similar presentations


Presentation on theme: "Development Environment Basics"— Presentation transcript:

1 Development Environment Basics
Dominik Gehl May 3rd, 2004 Development Environment Basics Developing the Tools May 3rd, 2004 Montréal, Québec Dominik Gehl Hôpital Ste-Justine, Montréal Lecture 1.2 (c) 2004 CGDN

2 Lab Objectives Become familiar with: Linux Eclipse Command line basics
Editors Eclipse Create a new Java Project Configure preferences Connect to a CVS server Lecture 1.2

3 Linux – Short Command Reference
List directory content ls –al directory/ Change directory cd ../../destination/ cd - Copy file cp source.txt destination.txt Move or rename file mv source.txt destination.txt Lecture 1.2

4 Other Useful Commands Lost in the directory tree ? pwd
Don’t know who you are anymore ? whoami Which files are executed ? which executableName Need help ? info command man command Lecture 1.2

5 Finding Files Several tools exist to help you find your files
By filename find / -name ”*pattern*” find can also be used to find files which have been modified in the last several days/hours/minutes etc. By file content fgrep –recursive –i pattern * Lecture 1.2

6 Let’s Find Eclipse Eclipse is installed on your computer … but where ?
Is it in the path ? which eclipse Let’s search for the filename “eclipse” find / -name “eclipse” find / -name “eclipse” … we can now start eclipse by typing /soft/diro/opt-linux-redhat-9.0/eclipse-3.0/eclipse Lecture 1.2

7 Linux File Permissions
Permissions can be given to read, write and execute files and directories Execute a directory means to be able to cd into the directory Read a directory means to be able to ls the files in the directory File permissions are given on a user, group, and ‘everyone else’ basis Lecture 1.2

8 File Permission Values
rw-r--r-x means that the owner has read and write rights, the group read-only rights and ‘everyone else’ read and execute r has a value of 4, w of 2 and x of 1 Calculate the sum and you have to numerical permission values (645 in the above example) Permissions can be changed with chmod Lecture 1.2

9 Linux References The Linux Documentation Project http://www.tldp.org
Introduction to Linux – A Hands on Guide The Linux System Administrators’ Guide Lecture 1.2

10 Secure File Transfers ssh allows you to execute commands on a remote server ssh –l login serverName scp allows to copy files between different computers scp . scp file If you don’t want to type your password every time, have a look at ssh-keygen Lecture 1.2

11 Editing Files Several editors are available:
vi Emacs Pico The most used ones are vi and emacs (both are installed by default and work in text-only mode) Lecture 1.2

12 Emacs Command Reference
Quit Ctrl-x Ctrl-c Save Ctrl-x Ctrl-s Save As Ctrl-x Ctrl-w Cancel Ctrl-g Select bloc Ctrl-Space Cut bloc Ctrl-w Paste bloc Ctrl-y Lecture 1.2

13 Vi Command Reference Quit Esc : q Save Esc : w
Quit without saving Esc : q! Save and quit Esc : wq Lecture 1.2

14 Editor References Emacs Vi
Main site Documentation and more Printable reference card Vi Lecture 1.2

15 Shells Different ‘shells’, which allow you to enter commands, are available: Ksh Csh Bash Until the end of the week, we will be using the bash shell. Lecture 1.2

16 Setting Environment Variables
To check the setting of an environment variable, you can use the echo command: echo $PATH Set an environment variable JAVA_HOME=/usr/java/j2sdk1.4.2_01 export JAVA_HOME To permanently set variables, enter the above commands in the .bashrc file Lecture 1.2

17 Bash Programming Basics
Do something to several files for i in `ls` do echo $i other commands here done If statements if [ -d fileName ]; then commands fi Lecture 1.2

18 Bash References Main site http://www.gnu.org/software/bash/bash.html
Advanced Bash-Scripting Guide Lecture 1.2

19 Eclipse Main Window Lecture 1.2

20 Create New Project File – New Project Lecture 1.2

21 Create New Class File – New Class Lecture 1.2

22 Edit Code Lecture 1.2

23 Run Application Lecture 1.2

24 Classpath Lecture 1.2

25 Add Variable to Classpath
Lecture 1.2

26 Debug from Eclipse Debugging can be done by inserting System.out.println statements all over your code … or (much better) Logging libraries (Log4j) By using the debugger integrated into Eclipse Just set a breakpoint after the start of the main method by double-clicking on the bar left of the edit window Lecture 1.2

27 Setting a breakpoint Lecture 1.2

28 Start Debugging Lecture 1.2

29 Run Step by Step Lecture 1.2

30 Run Step by Step Lecture 1.2

31 Configuration - Tabs or Spaces
Lecture 1.2

32 Configuration - Tabs or Spaces
Lecture 1.2

33 Configuration - Indentation
Lecture 1.2

34 Configuration - Indentation
Lecture 1.2

35 CVS Lecture 1.2

36 Eclipse References Main site http://www.eclipse.org
Eclipse FAQ Eclipse Plugins Lecture 1.2


Download ppt "Development Environment Basics"

Similar presentations


Ads by Google