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?
About Question enthuware.ocpjp.i.v11.2.3030 :
Moderator: admin
-
- Posts: 18
- Joined: Thu May 23, 2019 11:58 am
- Contact:
-
- Site Admin
- Posts: 10103
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.i.v11.2.3030 :
-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.
-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.
-
- Posts: 18
- Joined: Thu May 23, 2019 11:58 am
- Contact:
Re: About Question enthuware.ocpjp.i.v11.2.3030 :
Understood. Many Thank!
-
- Posts: 24
- Joined: Wed Sep 28, 2022 9:41 am
- Contact:
Re: About Question enthuware.ocpjp.i.v11.2.3030 :
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
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
-
- Site Admin
- Posts: 10103
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.i.v11.2.3030 :
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.
Who is online
Users browsing this forum: learningtocode and 10 guests