Programming 3

University of Alicante, 2023–2024

Practice sesions

Development of practice sessions

  • Compulsory attendance (max. 4 unexcused absences). Assignment controls do not admit unexcused absences.

Java Development Kit 1.8 installation

These instructions are for version 1.8 (also called Java 8), which is the one available in the labs.

The latest available version of Java is Java 20.

All Java versions are here

You can develop your assignments on a version of Java later than 8, since they support the code written for previous versions, but your code must work with version 8, that is, you must not include code that includes features of Java introduced later than this version. In the Java API classes documentation you can find the version from which they are available. However, using version 1.8 is recommended if possible.

Before submitting your work, make sure your code works on one of the machines in the labs in the same way than on your development machine.

For Linux machines

Follow instructions in this video: Installing Java 8 on Ubuntu/Linux (in spanish)

For Mac

Download the installer from Oracle:

Oracle Java SE Development Kit 8 Downloads

or view this video for installing the latests version, and configure the terminal to use it: Installing latest Java version on MacOS (in spanish)

For Windows

Read this page: How to Install JDK

Before installing the JDK, verify if it is already installed on your system by following the instructions in ‘Step 4: Verify the JDK Installation) from section ’1. How To Install JDK on Windows’.

Eclipse installation

Download and install it from

Eclipse IDE for Java Developers 2022-06

Submission rules

Your programming assignment must be written in Java under the GNU/Linux operating system. It must compile and run without errors with the 1.8 version of the Java compiler and virtual machine installed in the lab computers. From the second session, you must use the Eclipse Java IDE ‘2022-06-R’ in order to work with that Java version. Don’t use any other Eclipse version you may found on the lab machines.

Assignment submission

Assignments will be developed individually.

Submission must be made through the DLSI department submission server located at

The Oracle

For each assignment, you will have access to an oracle available on the submission server that will allow you to check if your implementation is correct. The oracle checks that your code passes all the correctness tests that will later be used in the assignment control. Also, it checks that your implementation is properly documented. It will send you a message to your official UA email account with the result (this may take a few minutes).

Been an oracle, it will not give you clues about what errors you have, it will only answer if the code and/or the documentation are correct or not. When submitting your code to the oracle, you will receive one of these possible responses:

  • Documentation: sin errores / CON ERRORES
  • Code evaluation: OK / INCORRECTO / NO COMPILA

You should target a documentation verdict sin errores and an OK in code evaluation. If you have errors in the documentation, use the Javadoc checker on your code. Unpack it and read the README.txt file to learn how to use it.

A INCORRECTO verdict indicates that your code does not meet some of the specifications in the assignment. This is verified through a series of automatic unit tests in addition to those provided with the assignment.

A NO COMPILA verdict obviously indicates that your code does not compile or the unit tests being used do not compile against your code. This is due to some error in your code (a misspelled class or method name, misspecified visibility, misspecified arguments, etc.).

Teachers do not answer online requests to review your code. In particular, we do not answer requests like ‘The oracle told me that my code is incorrect/doesn’t compile. I attach my code so you can tell me where it fails’.

Take advantage of the face-to-face lab sessions if you want the teacher to take a look at your code to answer your questions. You can also make use of the Moodle practice forum to answer questions about the assignments. ALERT! never post code to the forum!!.

The assignment control

Each assignment is evaluated by means of an in-lab control. In said control you will be asked to implement the corresponding assignment, for which it is in your interest to have done it before at home, and checked with the oracle that you did it well. On the day of the control you will have to do it again, but in person at the laboratory, except for the javadoc documentation part.

At an assignment control, a submission will be enabled on the submission server where you must upload your code. Unlike the oracle, you will not receive any report about the result of your code evaluation. The grading of your code will be published at the end of the week in which the control is carried out.

Conditions for taking the assignment control:

  • You must not enter the lab (even if it is the session starting time) until the teacher indicates to do so.
  • You must sit in the position indicated to you.
  • You should not turn on the PC until the teacher tells you to do so.
  • The use of personal computers during a control is not allowed. You will need to use the lab computer to implement and submit your code to the submission server.
  • You must not carry any kind of notes on paper with you. Everything you need to do the control will be available on the lab computers.
  • It is absolutely forbidden to connect any device to the laboratory computers during the controls. The connection of external USB or similar devices is monitored. The detection of connection of an external device to the computer that you are using to take the control implies a score of zero in the corresponding assignment.
  • You can only submit your work during the control session of your lab group, from the lab assigned to your group, and from a single PC of that lab. Any other submission attempt that does not meet these conditions will be detected and will lead to a score of zero in the corresponding control.
  • You can make several submissions during the control session, always fulfilling the above conditions.
  • As in any evaluation test, the regulations of the University of Alicante about assesment tests.
Extract from the regulations of the University of Alicante regarding assessment tests:

Entry into all examination rooms is strictly prohibited to anyone carrying any type of electronic device without exception. Contravening this prohibition will lead to being expelled from the exam and the qualification of zero points in the test to be carried out.

Likewise, on the table or on the floor there can be no other material than that indicated or delivered by the teacher. If you insist on taking any type of bag or backpack to the exam, it must be left hanging from the hangers on the wall, if any, or at the head of the room. The faculty will not guard anything and will not be held responsible for possible damage or theft, so it is recommended not to go to the exam with such items.

Normative reference:

“Regulations for the evaluation of learning”, approved by the Governing Council on November 27, 2015 and published in the BOUA on December 9), which says in its article 14, “Fraudulent performance of evaluation tests”:

  • Point 1. During the test, students are obliged to observe the rules on the authenticity of the exercise and its privacy. Behaviors or acts that contravene them may lead to their expulsion from the place where the test is carried out. […]
  • Point 5. Unless expressly authorized by the teaching staff responsible for the subject, the use or possession of mobile phones or any other electronic device not authorized by the teaching staff is prohibited during an evaluation test. Failure to comply with said obligation may lead to the expulsion of the student from the place where the test is carried out and the grade of zero in it, and this regardless of the application of the disciplinary measures to which it could give rise.

Character encoding of the source code

The source code for your assignment must use the Unicode UTF-8 character encoding. This is the default character encoding on Linux or Mac systems, but not on Windows which uses a different one by default. Character encoding mainly affects non-ASCII characters (accents, letters such as ñ, etc.) appearing in the code (mainly in comments). Source files that contain non-ASCII characters that are not encoded in UTF-8 cause compilation errors in the system that the instructors use to correct the assignments.

Here you can learn how to convert the character encoding of a text file in Linux or MacOS (in spanish).

The base Eclipse project that will be used from the second lab session is already configured to use UTF8 and Unix-like newline encoding.

Therefore, you must make sure that your source code is encoded in UTF-8. If you use Windows, do the following to verify your Eclipse project is correctly configured:

  1. In the project properties in Eclipse (project -> Properties), under the ‘Resource’ tab, the ‘Text file encoding’ section should indicate UTF8. If not, select ‘Other’ and then ‘UTF8’ in the drop-down box, then click ‘Apply and Close’.

  2. If you had non-ASCII characters, they will now probably appear as strange characters that you must delete and replace with the corresponding correct UTF-8 characters. This will happen if you add source code files to the project that have been created and/or edited on Windows with certain apps like the Windows Notepad. Avoid using such apps to write code.