在D:\gt3test\gt3tutorial\core\first的目录下有impl和Math两个文件夹.
Math下有我编译好的类MathPortType.class(package gt3tutorial.core.first.Math)
我在impl里的MathImpl.java中调用Math\MathPortType.class我这样写:
...
import gt3tutorial.core.first.Math.MathPortType;
...编译时:javac MathImpl.java出现下面错误:
package gt3tutorial.core.first.Math does not existe;我在classpath中加了D:\gt3test请教各位了!:)
Math下有我编译好的类MathPortType.class(package gt3tutorial.core.first.Math)
我在impl里的MathImpl.java中调用Math\MathPortType.class我这样写:
...
import gt3tutorial.core.first.Math.MathPortType;
...编译时:javac MathImpl.java出现下面错误:
package gt3tutorial.core.first.Math does not existe;我在classpath中加了D:\gt3test请教各位了!:)
除非把编译好的那个包先打包成jar
javac -classpath /*** filename记得不清楚了,试试吧!
和
D:\gt3test\gt3tutorial\core\first\MathMath里有编译好的类:
MathPortType.classpackage gt3tutorial.core.first.Math;public interface MathPortType extends java.rmi.Remote {
public int add(int in0, int in1) throws java.rmi.RemoteException;
public float divide(int in0, int in1) throws java.rmi.RemoteException;
public int multiply(int in0, int in1) throws java.rmi.RemoteException;
public int subtract(int in0, int in1) throws java.rmi.RemoteException;
}我在impl目录下的MathImpl.java中引用Math目录下的MathPortType.class
MathImpl.java
package gt3tutorial.core.first.impl;
import org.globus.ogsa.impl.ogsi.GridServiceImpl;
import gt3tutorial.core.first.Math.MathPortType;
import java.rmi.RemoteException;
public class MathImpl extends GridServiceImpl implements MathPortType
{
public MathImpl()
{
super("Simple Math Service");
}
public int add(int a, int b) throws RemoteException
{
return a + b;
}
public int subtract(int a, int b) throws RemoteException
{
return a - b;
}
public int multiply(int a, int b) throws RemoteException
{
return a * b;
}
public float divide(int a, int b) throws RemoteException
{
return a / b;
}
} 编译时就出现:
package gt3tutorial.core.first.Math does not existe;
找不到gt3tutorial.core.first.Math 为什么啊?
再次请教!:)
javac -classpath D:\ MathImpl.java
这样还是不行啊?
错误:
javac no source files-classpath 怎么用啊?格式是怎么样的?
这个啊,楼主用这个试试啊,晕
错误:
MathImpl.java:2: package org.globus.ogsa.impl.ogsi does not exist
import org.globus.ogsa.impl.ogsi.GridServiceImpl;
^
MathImpl.java:3: package gt3tutorial.core.first.Math does not exist
import gt3tutorial.core.first.Math.MathPortType;
^
MathImpl.java:5: cannot resolve symbol
symbol : class GridServiceImpl
location: class gt3tutorial.core.first.impl.MathImpl
public class MathImpl extends GridServiceImpl implements MathPortType
^
MathImpl.java:5: cannot resolve symbol
symbol : class MathPortType
location: class gt3tutorial.core.first.impl.MathImpl
public class MathImpl extends GridServiceImpl implements MathPortType4 errors2.用了javac -classpath D:\gt3test MathImpl.java
MathImpl.java:2: package org.globus.ogsa.impl.ogsi does not exist
import org.globus.ogsa.impl.ogsi.GridServiceImpl;
^
MathImpl.java:5: cannot resolve symbol
symbol : class GridServiceImpl
location: class gt3tutorial.core.first.impl.MathImpl
public class MathImpl extends GridServiceImpl implements MathPortType
^
2 errors
javac -classpath D:\;%CLASSPATH% MathImpl.java
“javac -classpath D:\;%CLASSPATH% MathImpl.java”中的
“D:\”
在这里起什么作用?
所以有没有D:\都无所谓的
呵呵。