【问题标题】:Java Web Service Client (Eclipse) doesn't compile but runsJava Web Service Client (Eclipse) 不编译但运行
【发布时间】:2014-05-02 12:32:48
【问题描述】:

我正在尝试使用 Windows 控制台编译 Java Web Service 客户端,但出现 100 个错误。客户端是在 Eclipse 中制作的,在它的控制台中运行良好。这是代码:

public static void main (String[] args)throws Exception{
    try{
        MireiaUPMPortTypeProxy proxy = new MireiaUPMPortTypeProxy();
        proxy.setEndpoint("http://138.4.47.33:8087/axis2/services/MireiaUPM.MireiaUPMHttpSoap11Endpoint/");
        String respuesta=proxy.getNER("[content]David is in the office.[/content]", "en");
        System.out.println(respuesta);
    }catch(Exception e3){
        e3.printStackTrace();
    }
}

}

当我编译时出现的错误类型是:找不到符号org.apache axis.constants不存在

你能帮帮我吗?我是使用网络服务的新手,我很迷茫。对我来说,额外的事情是它在 eclipse 控制台中运行良好,但无法编译。

【问题讨论】:

  • 如何在 windows cmd 中执行?罐? .class ?

标签: java eclipse web service compilation


【解决方案1】:

它在 Eclipse 中运行只是因为在 Eclipse 构建路径中设置了依赖库(jars!)。

为了能够从操作系统控制台/终端进行编译,您必须正确设置类路径。检查 Eclipse 构建路径(右键单击项目并查找此菜单)并在控制台命令中添加这些依赖项。

【讨论】:

    【解决方案2】:

    在编译类文件时,请确保所有相关的 jar 文件都在类路径中。

    【讨论】:

      猜你喜欢
      • 2021-06-06
      • 2011-02-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多