Skip to content

is unsafe needed? chapter 02 creating your first java module #1

Open
@marabesi

Description

@marabesi

Hello there,

I came across the Chapter 02 example where we are compiling a single module from scratch. When I try to compile the example with the following command:

javac -d out --module-source-path src --module packt.addressbook

I see the following:

import sun.misc.Unsafe;
          ^
  (package sun.misc is declared in module jdk.unsupported, but module packt.addressbook does not read it)
1 error

I am using java 11 to run the examples, I am not sure if this is related and I was navigating the code and I saw that the import is not used in the code:

Anyways I was wondering if the import is needed in the code? Is it related to the java version I am running?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions