INFO0062 - Object-Oriented Programming

Transcription

INFO0062 - Object-Oriented ProgrammingProgramming in Java with Network 8Jean-François GrailetUniversity of LiègeFaculty of Applied SciencesAcademic Year 2018 - 2019

How to use Network 8Graphical components and remote useNetwork 8A set of computers located at the Montefiore Institute (B28) Room I.99 Room "Bibliothèque" (second floor, shortly before I.99) Roughly 18 computers (from ms801 to ms818 as of February 2019)Run with a Linux distribution (Ubuntu) Therefore, tools and interface are very similar to the B37 computers.Provide Java 8.javac and java commands are available in the terminal.Also provide the Gedit text/code editor.1 / 20

How to use Network 8Graphical components and remote useWhy should you use Network 8 ?Network 8 will be your reference for the compilation of the project. A project that compiles on Network 8 is guaranteed to compile upon its review. Any kind of error, warning. encountered at review means lost points. In a sense, it’s a security for the submission.Note that Network 8 is also a reference environment for other courses. If you follow computer science courses, you will eventually use it anyway.Network 8 is also convenient if you don’t have a laptop. E.g., you can work on a programming assignment at the B28 during lunch breaks.2 / 20

How to use Network 8

How to use Network 8Graphical components and remote useHow to use Network 8You can use Network 8 computers locally or remotely.Local usage I.e., you can directly use them at Montefiore Institute. You will need a Montefiore account and a mouse. Everything for Java programming is already available on these machines.Remote usage Using different pieces of software, you can use Network 8 from home. This is handy to check your project compiles fine without coming to B28.In both situations, you will use the terminal and javac/java to code. Check the tutorial on programming in Java with the terminal.3 / 20

How to use Network 8Graphical components and remote useMontefiore accountGrants you access and a personal directory on Network 8 computers. It works just like pmli accounts on B37 computers. Except you can access them anytime (lunch time, before a course, etc.). Note that the disk space allocated for each user is limited to 500 Mo. You also have to bring your own mouse or borrow one (caution: 10 C).You can create an account online. Go to hp Provide your ULiège registration number1 and password.You can access your directory from any machine.1FR: votre matricule, au format sXXXXXX4 / 20

How to use Network 8Graphical components and remote useRemote access on Network 8To use Network 8 computers remotely, you’ll need the following software. A text editor with code coloration to create and edit your Java code A (S)FTP client to transfer your .java files between your computer and Network 8 A SSH client to open a remote terminal on a Network 8 computerSome good text editors Windows - Notepad macOS - TextWrangler Linux - Geany Alternatively, on Ubuntu and alike, you can use Gedit.5 / 20

How to use Network 8Graphical components and remote useFile transfer with Network 8You have to use the SFTP protocol to transfer your .java files on Network 8.Simplest method: use FileZilla.FileZilla is available for any common operating system.Note for macOS and LinuxUbuntu and alike - filezilla package.Another solution (for command-line experts): scp [-r] files user@ms8XX.montefiore.ulg.ac.be:remote dirFurther information: man scp.6 / 20

How to use Network 8Graphical components and remote useNetwork 8 - FileZillaFileZilla GUI (Graphical User Interface) (under Windows)7 / 20

How to use Network 8Graphical components and remote useNetwork 8 - FileZilla (II)(1) FileZilla log: displays the connexion and operations in details. Fast connection form (see next slide) is located just above.(2) Local file system: your file system, in a tree view.(3) Remote file system: file system of the remote host (after connection).(4) Local directory: displays the content of one of your directories. Do a double left click on a file to send it (right click for more options).(5) Remote directory: does the same for a directory on the remote host. Do a double left click on a file to download it (right click for more options).(6) Queue: if you handle several files at once, displays the transfer queue.8 / 20

How to use Network 8Graphical components and remote useNetwork 8 - FileZilla (III)Example of connection to ms803 by the student user:Host (1): sftp://ms803.montefiore.ulg.ac.beUsername (2): studentPassword (3): password9 / 20

How to use Network 8Graphical components and remote useNetwork 8 - FileZilla (IV)This message usually appears at your first connection.You just have to check the box to avoid this message.Note: this message will pop for each distinct ms8xx.10 / 20

How to use Network 8Graphical components and remote useNetwork 8 - Remote terminalYou have to use the SSH protocol to open a remote terminal on Network 8.Windows - Use PuTTY, a free SSH client.macOS and Linux - Use the ssh command.In any case, you will have to use command lines. Tutorial on basic commands (in French)11 / 20

How to use Network 8Graphical components and remote useNetwork 8 - PuTTYUnlike most programs, you don’t have to install PuTTY.You might however get a security warning when running it.Accept to run the program.12 / 20

How to use Network 8Graphical components and remote useNetwork 8 - PuTTY (II)A small window with a lot of menus will open.Type the address of a Network 8 machine in "Host" and click on "Open". In the example, ms801.montefiore.ulg.ac.be.13 / 20

How to use Network 8Graphical components and remote useNetwork 8 - PuTTY (III)Like with FileZilla, you will get a small warning.Just tell you trust the remote host by clicking "Yes".This happens only once for each ms8XX machine.14 / 20

How to use Network 8Graphical components and remote useNetwork 8 - PuTTY (IV)A terminal will open. Enter your credentials2 .You can now interact with the remote host with command lines.2FR: identifiants de connexion15 / 20

How to use Network 8Graphical components and remote useNetwork 8 - ssh commandJust run this command: ssh student@ms8XX.montefiore.ulg.ac.beReplace student with your Montefiore username.Replace XX with two digits matching a machine (01 to 18).If a security warning appears, just reply "yes" to continue connecting.Enter your password and you’re set to interact remotely with Network 8.Linux - If ssh command is not recognized, install OpenSSH. sudo apt-get install openssh-client16 / 20

How to use Network 8Graphical components and remote useNetwork 8 - ssh command (II)17 / 20

How to use Network 8Graphical components and remote useBeware of plagiarism !On Network 8, anyone can access your user directory !Hopefully, you can create directories that only you can access and manage.Create one for your Java files (for instance: INFO0062).Protect this directory with the appropriate rights, using this command: mkdir INFO0062 && chmod 700 INFO0062Verification: ls -l.drwx-----.7 student student4096 12 fév 02:54 INFO006218 / 20

Graphical components and remote use

How to use Network 8Graphical components and remote useGraphical SSHFor some exercises, we will use graphical elements (such as windows).In that case, testing a Java project on Network 8 requires “graphical SSH”.Linux: you just have to add the -YC options to ssh.macOS: Same procedure. However, you must install XQuartzfirst.Windows: You must install Xmingfirst. Follow this guide to integrate Xming into Putty. Check Enable compression in the Connection SSH panel.19 / 20

How to use Network 8Graphical components and remote useGraphical SSH (II)20 / 20

How to use Network 8 Graphical components and remote use Montefiore account Grants you access and a personal directory on Network 8 computers. It works just like pmli accounts on B37 computers. Except you can access them anytime (lunch time, before a course, etc.). Note that the