About Question enthuware.ocpjp.i.v11.2.3030 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
hamzaBlm
Posts: 18
Joined: Thu May 23, 2019 11:58 am
Contact:

About Question enthuware.ocpjp.i.v11.2.3030 :

Post by hamzaBlm »

Is it possible to specify both of these options in the same javac command --module-source-path and -p(--module-path)?
Can't we just use one without using the other when compiling?

Update:
(I've read the docs) I don't understand the -m(--module) option. It says Compiles only the specified modules. Just to make sure: If we don't specify the -m option, javac will compiles all the modules found in c:\java\a and c:\java\c?

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

Re: About Question enthuware.ocpjp.i.v11.2.3030 :

Post by admin »

-p is required only if your module depends on other modules to compile.

-m option is required if you want to compile all files of the given module. If you don't specify -m, then you must list the java files that you want to compile. If you don't give -m and don't specify any java files either, then javac will give error.
If you like our products and services, please help us by posting your review here.

hamzaBlm
Posts: 18
Joined: Thu May 23, 2019 11:58 am
Contact:

Re: About Question enthuware.ocpjp.i.v11.2.3030 :

Post by hamzaBlm »

Understood. Many Thank!

edufin166@yahoo.com
Posts: 24
Joined: Wed Sep 28, 2022 9:41 am
Contact:

Re: About Question enthuware.ocpjp.i.v11.2.3030 :

Post by edufin166@yahoo.com »

Hello,

The answer given was "Class files will be created under c:\java\b\x.y"

If I understood, "x.y" folder will be created under \b" folder.

So.... When we have a module with "composed-name" (such as "x.y"), a folder with "exact" same name, will be created under the ".class" files location after the compilation. I understood right?

thanks a lot

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

Re: About Question enthuware.ocpjp.i.v11.2.3030 :

Post by admin »

Yes, the class files creation location (i.e. the output of javac location) is governed by -d option. In this question, it is -d c:\java\b , so the output will be created under c:\java\b. Since module name is x.y, a directory named x.y will be created under c:\java\b and class files will be created under c:\java\b\x.y (as per their package names)
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 41 guests