Brian
Brian

Reputation: 162

Missing package "sun.java2d.cmm" - anyone know where I am supposed to get it?

I've recently pulled down a much newer version of a large project, updated to use a new (well new-er) version of Java (11 instead of 8). However I'm getting an error on the following import:

import sun.java2d.cmm.ProfileDeferralMgr;

And an error of "The import sun.java2d.cmm cannot be resolved"

My various googling, although it produces plenty of blah-blah-blah about sun.java2d.cmm, has not yet told me anything about where I'm supposed to get the package from.

Is this a package that I'm supposed to already "have" and I somehow don't have Eclipse set up to find it? Or is it something that I'm supposed to go "get" and download (if so does anyone know where?)

I'm using 14.0.1 SDK, and I've set it to build target for Java 11 (which is what this project is supposed to be built for as its minspec).

Any help much appreciated!

Upvotes: 0

Views: 1060

Answers (1)

Harald
Harald

Reputation: 5113

The package is part of the JDK, but its not supposed to be used publicly. Try this:

% cd jdk-14.0.1/
% bin/jshell
|  Welcome to JShell -- Version 14.0.1
|  For an introduction type: /help intro

jshell> import sun.java2d.cmm.ProfileDeferralMgr;
|  Error:
|  package sun.java2d.cmm is not visible
|    (package sun.java2d.cmm is declared in module java.desktop, which does not export it)
|  import sun.java2d.cmm.ProfileDeferralMgr;
|         ^------------^

Interestingly the same error happens in a jdk-11, so I wonder how the project you pulled down builds at all. The answers to this question may help or this.

Upvotes: 1

Related Questions