You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何解决构建时出现的java: No enum constant javax.lang.model.element.Modifier.SEALED错误?

问题:SSL RMI客户端编译报错“java: No enum constant javax.lang.model.element.Modifier.SEALED”

我正在完成大学项目,需要实现一个通过SSL RMI连接与barowner客户端通信的registrar服务器。目前服务器构建无异常,但客户端编译时出现错误:
java: No enum constant javax.lang.model.element.Modifier.SEALED

BarownerMain.java

package com.example.BarOwner;

import com.example.registrar.RegistrarInterface;

import javax.rmi.ssl.SslRMIClientSocketFactory;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

public class BarOwnerMain {
    public static void main(String[] args) throws RemoteException {

        String pass = "password";
        System.setProperty("javax.net.ssl.debug", "all");
        System.setProperty("javax.net.ssl.keyStore", System.getProperty("user.dir") + "/keys/raynaud.jks");
        System.setProperty("javax.net.ssl.keyStorePassword", pass);
        System.setProperty("javax.net.ssl.trustStore", System.getProperty("user.dir") + "/keys/raynaud.jks");
        System.setProperty("javax.net.ssl.trustStorePassword", pass);

        Registry registrarRegistry;
        RegistrarInterface registrarInterface;
        try {
             registrarRegistry = LocateRegistry.getRegistry(
                    InetAddress.getLocalHost().getHostName(), 1112,
                    new SslRMIClientSocketFactory());
            registrarInterface = (RegistrarInterface) registrarRegistry.lookup("RegistrarService");
            BarOwnerMenu.showMenu(registrarInterface);
        } catch (RemoteException | NotBoundException e) {
            throw new RuntimeException(e);
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }

    }
}

我已尝试按照JDK-8244367中的说明修改javax.lang.module,但IntelliJ不允许操作,恳请提供帮助!

内容的提问来源于stack exchange,提问作者Raynaud Cornille

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.09 19:05:24