Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/322.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将语言级别设置为Java8会使某些方法消失_Java_Maven_Java 8 - Fatal编程技术网

将语言级别设置为Java8会使某些方法消失

将语言级别设置为Java8会使某些方法消失,java,maven,java-8,Java,Maven,Java 8,我目前正在尝试使用API设置一个Beam交互式应用程序,但遇到了一个问题 BeamAPI beam = new BeamAPI("oauthtoken"); BeamUser user = beam.use(UsersService.class).getCurrent().get(); pro.beam.interactive.robot.Robot robot = new RobotBuilder() .channel(user

我目前正在尝试使用API设置一个
Beam
交互式应用程序,但遇到了一个问题

    BeamAPI beam = new BeamAPI("oauthtoken");
    BeamUser user = beam.use(UsersService.class).getCurrent().get();

        pro.beam.interactive.robot.Robot robot = new RobotBuilder()
                .channel(user.channel)
                .build(beam, false)
                .get();

        robot.on(Protocol.Report.class, report -> {
            // If we have any joysticks in the report

            if (report.getJoystickCount() > 0) {
                // Get the coordMean from the joystick
                Protocol.Coordinate coordMean = report.getJoystick(0).getCoordMean();
                Point mousePosition = MouseInfo.getPointerInfo().getLocation();

                // Apply it to the current mouse position, if its values are not NaN
                if (!Double.isNaN(coordMean.getX()) && !Double.isNaN(coordMean.getY())) {
                }
            }
        });


}
问题是,诸如
getJoystickCount
之类的方法没有显示,也没有得到解决,但是如果我将语言级别设置为java 7,所有方法都会正确显示,但代码不起作用,因为它使用java 8中的lambdas

所有maven设置都是为Java8设置的,还有项目设置和反编译
协议
类,所有方法都在那里

是什么导致了这个问题

这是我的POM文件:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>beamplays</groupId>
<artifactId>splix</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>

<repositories>
    <repository>
        <id>beam-releases</id>
        <url>https://maven.beam.pro/content/repositories/releases/</url>
    </repository>
    <repository>
        <id>beam-snapshots</id>
        <url>https://maven.beam.pro/content/repositories/snapshots/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>pro.beam</groupId>
        <artifactId>api</artifactId>
        <version>3.0.3-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>pro.beam</groupId>
        <artifactId>interactive</artifactId>
        <version>1.5.1-SNAPSHOT</version>
    </dependency>
</dependencies>

4.0.0
比姆普拉斯
splix
1.0-快照
org.apache.maven.plugins
maven编译器插件
1.8
1.8
光束释放
https://maven.beam.pro/content/repositories/releases/
光束快照
https://maven.beam.pro/content/repositories/snapshots/
前束
应用程序编程接口
3.0.3-快照
前束
互动的
1.5.1-快照

即使有错误,我也尝试运行代码,在添加它之后,得到了一个NoClassDefFoundError askin for Google Protobuf,一切正常。

即使有错误,我尝试运行代码,在添加它之后,得到了一个NoClassDefFoundError askin for Google Protobuf,一切正常。

显示您的maven pom文件,另外,您使用的是哪个IDE?我使用IntellIJ Idea,我将pom文件添加到maven编译器插件依赖项中的问题Add
3.6.1
,清理您的项目并更新它(不知道它在IntellIJ中的位置,在eclipse中它将是alt+f5),然后检查它again@JorgeCampos. 这里的讨论并没有向前推进,但在我的浏览器的默认字体中,“m”看起来很像“r+n”。“pom文件”这句话让我有点吃惊:@madpysicast lol hard now:)!!下次我会用大写字母写的!谢谢你的提醒!!显示您的maven pom文件,以及您使用的IDE?我使用IntellIJ Idea,我将pom文件添加到问题中添加
3.6.1
,在maven编译器插件依赖项中,清理并更新项目(不知道它在IntellIJ中的位置,在eclipse中它将是alt+f5),然后检查它again@JorgeCampos. 这里的讨论并没有向前推进,但在我的浏览器的默认字体中,“m”看起来很像“r+n”。“pom文件”这句话让我有点吃惊:@madpysicast lol hard now:)!!下次我会用大写字母写的!谢谢你的提醒!!