试图运行这个程序.我认为要设置我需要运行apt的所有Web服务.(虽然使用javac我遇到了同样的问题).我认为我得到的是编译错误.(如下图所示).
我想我需要做的是在我的类路径中包含这个jar:jsr181-api.jar (source).有没有一个简单的临时方法(在solaris上)?我不想将它添加到我的bash_rc文件中(它永远存在).我也知道有一些方法可以使用清单文本文件,但这似乎很复杂,所以我还没有调查它.我可以这样做:
javac HelloImp <listOfJars>
Run Code Online (Sandbox Code Playgroud)
要么
ant HelloImp <listOfJars>
Run Code Online (Sandbox Code Playgroud)
码:
package server;
import javax.jws.WebService;
@WebService
public class HelloImpl {
/**
* @param name
* @return Say hello to the person.
*/
public String sayHello(String name) {
return "Hello, " + name + "!";
}
}
Run Code Online (Sandbox Code Playgroud)
编译错误:
HelloImpl.java:3: package javax.jws does not exist
import javax.jws.WebService;
^
HelloImpl.java:5: cannot find symbol
symbol: class WebService
@WebService
^
2 errors
Run Code Online (Sandbox Code Playgroud)
更新:酷包裹但仍然不能正常工作.我创建了一个新问题,以保持良好和有条理:
我正在使用带有hadoop 2.2.0的cassandra-all 2.0.7 api .
<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>zazzercode</groupId>
<artifactId>doctorhere-engine-writer</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>DoctorhereEngineWriter</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<cassandra.version>2.0.7</cassandra.version>
<hector.version>1.0-2</hector.version>
<guava.version>15.0</guava.version>
<hadoop.version>2.2.0</hadoop.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>zazzercode.DiseaseCountJob</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>me.prettyprint</groupId>
<artifactId>hector-core</artifactId>
<version>${hector.version}</version>
<exclusions>
<exclusion>
<artifactId>org.apache.thrift</artifactId>
<groupId>libthrift</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>cassandra-all</artifactId>
<version>${cassandra.version}</version>
<exclusions>
<exclusion>
<artifactId>libthrift</artifactId>
<groupId>org.apache.thrift</groupId>
</exclusion>
</exclusions>
</dependency> …Run Code Online (Sandbox Code Playgroud)