title: Java - compilation error: cannot access Function
body: <p>I have osgi project. Every bundle is a separate maven project. Project is large enough and includes about 10 bundles. Everything works and is ok.</p>
  
  <p>Today I've added one more library - <a href="https://code.google.com/p/owasp-java-html-sanitizer/" rel="nofollow">https://code.google.com/p/owasp-java-html-sanitizer/</a> . I've set all dependencies and ide (netbeans 8) shows everything is ok. However I get the following compilation code in this method:</p>
  
  <pre><code>@Override
  public void sanitize(Map&lt;String,Object&gt; policies){
      PolicyFactory  policy=(PolicyFactory) policies.get("html0");
      this.code=policy.sanitize(this.code);
  }
  </code></pre>
  
  <p>At the second line of the method (this.code...) I get the following compilation error: cannot access Function. Can't understand what it is about...
  <br>
  <strong>EDIT<br></strong>
  Import section:</p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.Date;
  import java.util.List;
  import java.util.Map;
  import org.owasp.html.PolicyFactory;
  </code></pre>
  
  <p><br>
  EDIT<br></p>
  
  <pre><code>COMPILATION ERROR : 
  -------------------------------------------------------------
  com/subjects/SubjectDirItemCore.java:[166,24] error: cannot access Function
  1 error
  -------------------------------------------------------------
  ------------------------------------------------------------------------
  BUILD FAILURE
  ------------------------------------------------------------------------
  Total time: 1.687s
  Finished at: Wed Feb 18 16:11:11 MSK 2015
  Final Memory: 14M/205M
  </code></pre>
  
  <p><br>
  <strong>EDIT</strong> <br> - I tried via mvn install -X</p>
  
  <blockquote>
    <p>org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
    execute goal
    org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
    (default-compile) on project com.....: Compilation failure
    ..../subjects/SubjectDirItemCore.java:[166,24] error: cannot access
    Function</p>
    
    <p>at
    org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
      at
    org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at
    org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at
    org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
      at
    org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      at
    org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      at
    org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)   at
    org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)  at
    org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)  at
    org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)   at
    org.apache.maven.cli.MavenCli.main(MavenCli.java:141)     at
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)   at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)     at
    org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
      at
    org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
      at
    org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
      at
    org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
    Caused by: org.apache.maven.plugin.CompilationFailureException:
    Compilation failure /..../subjects/SubjectDirItemCore.java:[166,24]
    error: cannot access Function</p>
    
    <p>at
    org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:656)
      at
    org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
      at
    org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      at
    org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      ... 19 more [ERROR]</p>
  </blockquote>