[HD Pg 0, Sec. 4.5.1 - compilation-and-execution-involving-packages]

Oracle Certified Foundations Associate Java Certification Questions and Discussion
1Z0-811

Moderator: admin

Post Reply
billieJava
Posts: 3
Joined: Wed Jul 26, 2023 8:29 pm
Contact:

[HD Pg 0, Sec. 4.5.1 - compilation-and-execution-involving-packages]

Post by billieJava »

Hi,

I tried running the suggested command, section 4.5.2, page 271: jar -cvf accounting.jar accounting

I am getting the error:

'jar' is not recognized as an internal or external command,
operable program or batch file.


I tried to troubleshoot, looking up solutions, I changed my java Path as per this posting (https://www.geeksforgeeks.org/how-to-se ... and-linux/), it did not help. (...now I'm worried that this Path change was unnecessary and may cause future problems?).

Any suggestions? Thanks.

Windows 11 pro on Mac M1 via Parallels
Java 20 for Windows

Update: I tried the above completely within the Mac OS environment (Mac terminal, Mac folders, Mac java installation 19.0.2), no problems. So I guess my problem is a Windows on Mac problem? Or a Java 20 problem? Thanks again. For now, I will continue the course on Mac. Will this be a problem in future chapters?

admin
Site Admin
Posts: 10065
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: [HD Pg 0, Sec. 4.5.1 - compilation-and-execution-involving-packages]

Post by admin »

I havent tried using the set that you have (windows on mac) so i am unable to say what might be the cause for sure. Generally, the jar executable is in the bin directory of the java installation, so, on you need to add that bin directory to the PATH.

What is your PATH set to currently? and where is your jdk located?

Are you able to compile and run java programs ? I mean, is just the jar command not working or are javac and java not working either?



No, continuing the course on Mac will not be a problem. Just change \ to / in the paths used i the examples.
If you like our products and services, please help us by posting your review here.

billieJava
Posts: 3
Joined: Wed Jul 26, 2023 8:29 pm
Contact:

Re: [HD Pg 0, Sec. 4.5.1 - compilation-and-execution-involving-packages]

Post by billieJava »

Hi,

Thank you for your prompt reply, it is much appreciated.

It seems everything is running properly today. I forgot rule #1 for troubleshooting: restart!

There was no prompt to restart when I changed PATH settings, but after discovering everything worked fine today, I assumed the restart fixed it. I found the following recommendation online regarding PATH environment variable changes: "The changes will take effect immediately but most programs only check the values of environment variables when they first start running. This means that you do not have to restart Windows but you may need to restart your application for the changes to take effect"

Thanks again, sorry if this was a waste of time,

Julian

Post Reply

Who is online

Users browsing this forum: No registered users and 130 guests