The “import java.util.function cannot be resolved” error

后端 未结 8 1599
感动是毒
感动是毒 2021-01-11 12:49

I\'m trying to run this practice script from the standard Oracle Java tutorials.

This seems to be a common error and I\'ve used SO resources to make attempts to fix

8条回答
  •  盖世英雄少女心
    2021-01-11 13:32

    Per the java.util.function Javadoc,

    Since:
          1.8
    

    So upgrade to Java 8, or try to find an older version of the tutorial.

    I'm new at this. How can you tell what you are running? I'm using Eclipse

    To determine your current Java version in eclipse, go to

    Help -> About Eclipse -> Installation Details (Button in
              lower Left) -> Configuration pane
    

    Look for the line java.specification.version - on my machine that is

    java.specification.version=1.8
    

    Or the line java.runtime.version - on my machine that is

    java.runtime.version=1.8.0_11-b12
    

提交回复
热议问题