I've started preparing for my ocp exams for java se 17 for the last couple of weeks. I've completed most of the practical code examples given in the ocp study guide by Selikoff and Boyarsky but faced issues in the modules chapter. I have downloaded the jdk for java 17 from the oracle website. The java and javac commands work perfectly fine but I face issues when it comes to creating jars with the jar command from the cmd prompt.
I tried running the jar command by itself and here's the error message I got:
D:\>jar
'jar' is not recognized as an internal or external command,
operable program or batch file.
when I try java -jar I get this message:
D:\>java -jar
Error: -jar requires jar file specification
Usage: java [options] <mainclass> [args...]
(to execute a class)
...
I've tried reinstalling the entire jdk and tried updating my path variables but can't seem to resolve this issue. I've even tried the methods under this post --> text but couldn't seem to fix it. Pls help me resolve this issue.
I'm using a lenovo laptop with an AMD Ryzen 3 5300U with Radeon graphics (2.6GHz, x64 arch) processor with a windows 11 installation with all the latest updates.