You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by Chris Westin <ch...@gmail.com> on 2015/06/19 17:02:33 UTC

Build failure in Eclipse: Type Access restriction: The method 'VM.maxDirectMemory()' is not API

I rebased a large set of changes against apache/master yesterday afternoon,
and now I can't build in Eclipse. I get the above warning in
DrillConfig.java, on this line:

  @SuppressWarnings("restriction")  private static final long
MAX_DIRECT_MEMORY = sun.misc.VM.maxDirectMemory();


It builds fine from maven on the command-line, but not in eclipse (which is
preventing me from debugging a unit test).


When I mouse over the error indicator on the left-hand side of the file
editor, I see these:

Multiple markers at this line

- Unnecessary @SuppressWarnings("restriction")

- Access restriction: The method 'VM.maxDirectMemory()' is not API
(restriction on required library '/Library/Java/JavaVirtualMachines/

 jdk1.7.0_71.jdk/Contents/Home/jre/lib/rt.jar')

- Access restriction: The type 'VM' is not API (restriction on required
library '/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/

  jre/lib/rt.jar')


There are no suggestions, and I'm not seeing anything obvious in web
searches. Any ideas on how to proceed?

Re: Build failure in Eclipse: Type Access restriction: The method 'VM.maxDirectMemory()' is not API

Posted by Chris Westin <ch...@gmail.com>.
Solved.

Removing and re-adding the JRE library as described here fixed it:
http://stackoverflow.com/questions/1089904/access-restriction-on-class-due-to-restriction-on-required-library/5746532#5746532
.  Weird, huh?


On Fri, Jun 19, 2015 at 8:02 AM, Chris Westin <ch...@gmail.com>
wrote:

> I rebased a large set of changes against apache/master yesterday
> afternoon, and now I can't build in Eclipse. I get the above warning in
> DrillConfig.java, on this line:
>
>   @SuppressWarnings("restriction")  private static final long
> MAX_DIRECT_MEMORY = sun.misc.VM.maxDirectMemory();
>
>
> It builds fine from maven on the command-line, but not in eclipse (which
> is preventing me from debugging a unit test).
>
>
> When I mouse over the error indicator on the left-hand side of the file
> editor, I see these:
>
> Multiple markers at this line
>
> - Unnecessary @SuppressWarnings("restriction")
>
> - Access restriction: The method 'VM.maxDirectMemory()' is not API
> (restriction on required library '/Library/Java/JavaVirtualMachines/
>
>  jdk1.7.0_71.jdk/Contents/Home/jre/lib/rt.jar')
>
> - Access restriction: The type 'VM' is not API (restriction on required
> library '/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/
>
>   jre/lib/rt.jar')
>
>
> There are no suggestions, and I'm not seeing anything obvious in web
> searches. Any ideas on how to proceed?
>
>
>