User Tools

Site Tools


installation

The Java training online

Back to the table of contents

0. Installation

Capsis can be run on several systems. This training can be followed under Linux, Windows or MacOSX. Installations are required before starting the exercises: an expected version of the Java Development Kit and the Java exercises archive must be installed, see blow.

0.1 How to use the terminal

Where is the terminal ?

During the training, you will need to enter commands in the terminal.

  • Under Linux, the terminal is called a shell, search an application called 'shell' or 'terminal'
  • under Windows it is a command-prompt: try 'Ctrl+r', or execute 'cmd', or look in 'Programs > Accessories'
  • under MacOSX, it is called a terminal: find the 'terminal' icon or look in 'Applications > Utilities'.

Current directory

In the terminal, you are always located in a directory: the current directory (or folder), you can see it in the prompt (where you are supposed to type a command)

Main commands

Under Linux and Mac, the commands are the same (Unix commands) and '~' means 'your home (personal) directory'

Linux / MacOSX Windows
see the current directorypwd (print working directory)echo %cd% (or just cd)
get the list of files in this directoryls (list files and directories) dir
move down into a directorycd directoryName (change directory) cd directoryName
move up one directorycd .. cd ..
create a new directory in the current directorymkdir directoryName (make directory)mkdir directoryName

Commands in a Linux terminal

Back to the table of contents

0.2 Check if the java you need is already installed...

You need a Java Development Kit (JDK) installed, version 1.8 (higher may be ok).

Note: if you find a Java Runtime Environment (JRE), this can run Java programs but you will not have the java compiler we need to write Java programs, so a JDK must be installed.

Check this by entering the following two commands in your terminal, from whatever directory, they should both return the same version of Java.

All operating systems
version of java (i.e. the Java Virtual Machine, JVM) runs the java programs)java -version
version of the java compiler (to build java programs)javac -version

E.g. under Linux: both commands return version 1.8.0, correct (the number after the _ does not matter here)

coligny@marvin-13:~$ java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
coligny@marvin-13:~$ javac -version
javac 1.8.0_101
coligny@marvin-13:~$ 

Back to the table of contents

0.3 ... Or install Java on your computer

Where can I find Java ? (download)

The reference Java for Capsis is the version JDK 1.8 (or Java 8) by Oracle, or another provider.

See the Java 8 installation page: https://capsis.cirad.fr/capsis/documentation/java_8_installation_page

Back to the table of contents

0.4 Install a simple text editor

To write your programs, you need a simple text editor with few features including syntax coloring (colors for the Java keywords…). If you already have one, you can use it, else look at one of these:

For Windows:

  • TextPad
  • Notepad++

For Linux:

  • Gedit
  • SublimeText

For MacOSX:

  • TextWrangler
  • Atom

0.5 Create directories for your exercises

  • Create a base directory named practice/

The new directory must be somewhere you can access easily on your machine, you can create a directory with the terminal and mkdir, or with your file manager.

// Reminder: 'somewhere>' means: you are in the directory named 'somewhere', you may 
// type your command...

// E.g. (Windows) create a directory named 'practice' in C:\ with mkdir:
C:\> mkdir practice

// Good examples (Windows or Linux):
C:\practice>
/home/coligny/practice>

// Poorer example (Windows), too long, with accents and spaces in names: 
C:\Documents and Settings\My Documents\éléments de formation\formation capsis janvier 2021\practice>
  • in practice/, create a new directory named java/ to write your Java exercises.

For the following Java exercises, you will need to reach this practice/java/ directory in the terminal with cd like this:

// E.g. (Windows) create a directory named 'java' in 'practice'
C:\> cd practice
C:\practice> mkdir java
C:\practice> cd java
C:\practice\java>
  • in practice/, unzip the capsis-training.zip archive

EDIT May 2024: download the capsis-training-archive from FileSender

Important note

The archive may contain code which is not freely distributable, by unzipping it, you understand you must not distribute it and you agree to keep it for you. The practice/capsis4/ directory and the capsis-training.zip file may be removed after a while.

The capsis training archive contains a directory named capsis4/ and a copy of capsis to be used only for the time of this training course.

Back to the table of contents

installation.txt · Last modified: 2024/05/07 14:15 by coligny