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 4 articles in this topic
Showing 4 of 89 articles.
Currently no other people reading this forum.


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

Login to reply

👍?
helpful
2:34pm Tue 27th Feb, Andrew G.

Hi Bill, Particularly since one of the selling points of Java is "write once run anywhere", there are no requirements to use a particular system. We will probably use OpenJDK by default when marking, but since we are using Java version 11 in this unit, any specification-compliant implementation of Java 11 should be fine. So either OpenJDK or Oracle's official JDK should be fine. Use whatever works better for you. I can foresee no reason we would require you to use a particular operating system for anything in this unit. If I am wrong and one of our assessments requires a particular system, we will make that clear in the specifications for that assessment. By default you may assume that you can use whatever you prefer. Cheers, Gozz


SVG not supported

Login to reply

👍?
helpful
5:28pm Tue 27th Feb, William R.

Thanks for the response. I installed jdk 21 rather than jdk 11, is there a way I can compile to jdk11 from terminal like C's '-std=c11' flag or do I need a fresh install? Thanks again, Bill


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