1
00:00:00,006 --> 00:00:02,008
- [Instructor] One of the
biggest changes to Java 9

2
00:00:02,008 --> 00:00:05,006
is this thing called Project Jigsaw.

3
00:00:05,006 --> 00:00:07,008
In short, Project Jigsaw is actually

4
00:00:07,008 --> 00:00:11,000
going to modularize Java.

5
00:00:11,000 --> 00:00:16,006
JSR 376 is called Java
Platform Module System.

6
00:00:16,006 --> 00:00:20,004
The module system addresses
two fundamental needs

7
00:00:20,004 --> 00:00:22,008
of all large Java applications.

8
00:00:22,008 --> 00:00:27,003
One of the goals was to provide
a reliable configuration.

9
00:00:27,003 --> 00:00:28,002
This is to replace

10
00:00:28,002 --> 00:00:31,005
the fragile, error prone
class path mechanism

11
00:00:31,005 --> 00:00:33,006
that we're used to today.

12
00:00:33,006 --> 00:00:38,004
A second goal was to provide
strong encapsulation.

13
00:00:38,004 --> 00:00:40,007
The module system does this by declaring

14
00:00:40,007 --> 00:00:42,006
which of its public types are accessible

15
00:00:42,006 --> 00:00:45,006
to other components and which are not.

16
00:00:45,006 --> 00:00:49,002
By using this new module
system, we are able to provide

17
00:00:49,002 --> 00:00:54,000
a scalable platform with
greater platform integrity

18
00:00:54,000 --> 00:00:56,005
and improved performance.

19
00:00:56,005 --> 00:01:01,007
As I stated earlier, a
JSR such as this, JSR 376,

20
00:01:01,007 --> 00:01:04,007
can contain one or many JEPs.

21
00:01:04,007 --> 00:01:06,008
Let's review the JEPs that are part

22
00:01:06,008 --> 00:01:09,000
of this whole Project Jigsaw.

23
00:01:09,000 --> 00:01:13,005
We have JEP 200, which is the modular JDK.

24
00:01:13,005 --> 00:01:15,007
So this is actually modularizing

25
00:01:15,007 --> 00:01:18,009
the Java development kit itself.

26
00:01:18,009 --> 00:01:24,004
We have JEP 201, which is
for modular source code.

27
00:01:24,004 --> 00:01:27,001
We have JEP 220, which allows you

28
00:01:27,001 --> 00:01:30,007
to create modular run-time images.

29
00:01:30,007 --> 00:01:36,000
JEP 260, which encapsulates
most of the internal APIs.

30
00:01:36,000 --> 00:01:40,003
JEP 261 is the module system itself

31
00:01:40,003 --> 00:01:43,004
so this is a big piece of the puzzle.

32
00:01:43,004 --> 00:01:47,009
JEP 282 is the introduction of jlink,

33
00:01:47,009 --> 00:01:49,008
which is a Java Linker.

34
00:01:49,008 --> 00:01:52,003
This new approach to
making Java modularized

35
00:01:52,003 --> 00:01:55,005
enables platform
implementations to be customized

36
00:01:55,005 --> 00:01:57,004
for various scenarios.

37
00:01:57,004 --> 00:02:01,001
This includes a customization
for small computing devices,

38
00:02:01,001 --> 00:02:04,002
such as a smartphone or
a tablet, all the way up

39
00:02:04,002 --> 00:02:06,009
to dense cloud deployments.

40
00:02:06,009 --> 00:02:10,000
The JDK itself, as I
stated, has been divided

41
00:02:10,000 --> 00:02:12,002
into a set of modules.

42
00:02:12,002 --> 00:02:14,009
This particular change allows programmers

43
00:02:14,009 --> 00:02:19,004
to combine JDK modules in a
variety of configurations.

44
00:02:19,004 --> 00:02:23,006
Some of those configurations
include the compact profiles

45
00:02:23,006 --> 00:02:26,004
that were defined in Java SE 8.

46
00:02:26,004 --> 00:02:29,000
In addition to the compact profiles,

47
00:02:29,000 --> 00:02:30,001
we have custom configurations

48
00:02:30,001 --> 00:02:32,001
with the reduced set of modules.

49
00:02:32,001 --> 00:02:34,003
Again, before Java was monolithic,

50
00:02:34,003 --> 00:02:36,004
where you got everything, every time.

51
00:02:36,004 --> 00:02:38,007
Now, you're only going
to get what you need,

52
00:02:38,007 --> 00:02:42,007
which will make you runtime
profiles much smaller.

53
00:02:42,007 --> 00:02:47,006
This release restructures the
JDK and JRE runtime images.

54
00:02:47,006 --> 00:02:50,008
By doing that, we are
improving performance security

55
00:02:50,008 --> 00:02:52,002
and maintainability.

56
00:02:52,002 --> 00:02:55,007
This new release also defines a new URI,

57
00:02:55,007 --> 00:02:58,006
a Uniform Resource Identifier.

58
00:02:58,006 --> 00:03:01,008
The new URI scheme is
used for naming modules,

59
00:03:01,008 --> 00:03:06,004
classes and resources that
are stored in a runtime image.

60
00:03:06,004 --> 00:03:09,001
It makes most of the JDKs internal APIs

61
00:03:09,001 --> 00:03:11,009
inaccessible by default.

62
00:03:11,009 --> 00:03:15,004
Since we have this change to
make those APIs inaccessible,

63
00:03:15,004 --> 00:03:18,002
it's important to test
your programs to make sure

64
00:03:18,002 --> 00:03:22,006
you don't have any dependencies
on these internal APIs.

65
00:03:22,006 --> 00:03:23,007
So in order to test for that,

66
00:03:23,007 --> 00:03:27,002
they've introduced a
new tool called jdeps.

67
00:03:27,002 --> 00:03:30,006
What you can do is you can run
jdeps from the command line

68
00:03:30,006 --> 00:03:36,002
with -jdkinternals space and
then the name of the class

69
00:03:36,002 --> 00:03:37,009
that you're trying to check.

70
00:03:37,009 --> 00:03:40,003
Jdeps is a new command line tool added

71
00:03:40,003 --> 00:03:43,000
since JDK 8 for developers to use

72
00:03:43,000 --> 00:03:45,003
to understand the static dependencies

73
00:03:45,003 --> 00:03:48,000
of their applications and libraries.

74
00:03:48,000 --> 00:03:50,002
To wrap up, modular development starts

75
00:03:50,002 --> 00:03:52,002
with a modular platform.

76
00:03:52,002 --> 00:03:55,004
So the Java SE platform is now scalable

77
00:03:55,004 --> 00:03:57,007
for small computing devices all the way up

78
00:03:57,007 --> 00:04:00,008
to larger applications.

79
00:04:00,008 --> 00:04:03,008
Before we wrap up this section,
I did want to take a look

80
00:04:03,008 --> 00:04:07,004
at what modules are included
when you download Java 9.

81
00:04:07,004 --> 00:04:11,000
I'm going to switch over
to a command prompt window

82
00:04:11,000 --> 00:04:14,004
and from here, I'm going to
navigate to my Java folder,

83
00:04:14,004 --> 00:04:20,000
so for me, that is under program files x86

84
00:04:20,000 --> 00:04:22,003
'cause I am on a Windows machine.

85
00:04:22,003 --> 00:04:24,008
From here, I want to go into Java

86
00:04:24,008 --> 00:04:29,001
and from here, I need
to switch over to JDK 9.

87
00:04:29,001 --> 00:04:32,002
Okay, I need to check the
name of that so I'll do a DIR.

88
00:04:32,002 --> 00:04:36,005
Whoops, I would need to do JDK-9.

89
00:04:36,005 --> 00:04:38,009
Now I want to run a list of the modules

90
00:04:38,009 --> 00:04:40,001
so I'm going to type in

91
00:04:40,001 --> 00:04:47,000
Java, space, dash, dash,
list, dash, modules.

92
00:04:47,000 --> 00:04:50,003
You can see, these are all
the modules that are included

93
00:04:50,003 --> 00:04:52,008
in the download of JDK 9.

94
00:04:52,008 --> 00:04:54,002
Probably the most important one

95
00:04:54,002 --> 00:04:57,004
is the second one on the
list, this Java.base.

96
00:04:57,004 --> 00:04:59,008
Java.base included all the libraries

97
00:04:59,008 --> 00:05:01,000
that we're used to using,

98
00:05:01,000 --> 00:05:05,003
such as Java.util, Java.lang,
but this is a great way

99
00:05:05,003 --> 00:05:09,000
to check to see what modules
are downloaded with your image.

