It's UWAweek 17 (1st semester, week 8)

help2005

This forum is provided to promote discussion amongst students enrolled in CITS2005 Object Oriented Programming.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

How do I ask a good question?
Displaying the 2 articles in this topic
Showing 2 of 89 articles.
Currently 1 other person reading this forum.


 UWA week 9 (1st semester, week 1) ↓
SVG not supported

Login to reply

👍?
helpful
6:39pm Tue 27th Feb, Andrew G.

Since in this unit we will only ask you to submit Java code, not compiled bytecode, all that matters is that any code you submit is compliant with the Java 11 specification. So long as you don't use any features introduced in more recent versions, this will be fine (e.g: https://openjdk.org/jeps/440 or https://openjdk.org/jeps/441, which were introduced with Java 21).

The most certain way to prevent yourself from accidentally using newer features is to install a Java 11 JDK, however there is indeed a flag to compile for a specific Java release: The --release flag. Per javac --help for OpenJDK 21: --release Compile for the specified Java SE release. Supported releases: 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21

So javac --release 11 MyClass.java should do what you want, as it will throw an error if you try to use features that weren't available in release 11.


SVG not supported

Login to reply

👍?
helpful
1:48am Wed 28th Feb, William R.

Very convenient Thank you for the help.

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  5:07AM Sep 06 2023
Privacy policy