这种也不行
C:\Documents and Settings\huangwei>javac -classpath E:\java\rmi\FrameWork\Source
\Client -d E:\java\rmi\FrameWork\Source\Client DemoClient_1.java
error: cannot read: DemoClient_1.java
1 error源代码 我帖出来 好郁闷 给我解答这个低级问题 public class DemoClient_1 {
/**
* Request processing of FrameWork Function 1.
* @param args java.lang.String[]
*/
public static void main(String args[]) {
// new string for FrameWork function
String x = "DemoClient_1 passed object"; // make obj
Object pass = (Object) x; // return array
Object back[] = null;
// form a parameter for FrameWork
FrameWorkParm TP = new FrameWorkParm(pass, // data
"F1", // function name
10, // wait time
1); // priority
// do a sync request
back = new SvrComm().syncRequest(TP);
// Should be an array
if (back == null) {
// say no good
System.out.println("Did not complete properly"); // bye
return; } // endif
// number of objects in array
int nbr = back.length; // Display string
String S = ""; // concatenate all the strings
for (int i = 0; i < nbr; i++) { // must be a string
if ((back[i] != null) &&
(back[i] instanceof String)) { // concat
S = S.concat((String) back[i]); } // endif
} // end-for
// say what
System.out.println(S);
return;
} // end-method
C:\Documents and Settings\huangwei>javac -classpath E:\java\rmi\FrameWork\Source
\Client -d E:\java\rmi\FrameWork\Source\Client DemoClient_1.java
error: cannot read: DemoClient_1.java
1 error源代码 我帖出来 好郁闷 给我解答这个低级问题 public class DemoClient_1 {
/**
* Request processing of FrameWork Function 1.
* @param args java.lang.String[]
*/
public static void main(String args[]) {
// new string for FrameWork function
String x = "DemoClient_1 passed object"; // make obj
Object pass = (Object) x; // return array
Object back[] = null;
// form a parameter for FrameWork
FrameWorkParm TP = new FrameWorkParm(pass, // data
"F1", // function name
10, // wait time
1); // priority
// do a sync request
back = new SvrComm().syncRequest(TP);
// Should be an array
if (back == null) {
// say no good
System.out.println("Did not complete properly"); // bye
return; } // endif
// number of objects in array
int nbr = back.length; // Display string
String S = ""; // concatenate all the strings
for (int i = 0; i < nbr; i++) { // must be a string
if ((back[i] != null) &&
(back[i] instanceof String)) { // concat
S = S.concat((String) back[i]); } // endif
} // end-for
// say what
System.out.println(S);
return;
} // end-method
1。检查classpath;
2。如果你是用记事本输入的源代码,请注意一下保存时选择的字符集,
实在郁闷 怎么会这样wwwwwwwwwwwww
C:\Documents and Settings\huangwei>javac -classpath E:\java\rmi\FrameWork\Source
\Client -d E:\java\rmi\FrameWork\Source Client.DemoClient_1.java
然后仔细研究一下-classpath与-d的具体含义,善哉善哉。。
c:
cd \test
C:\test>javac -classpath E:\java\rmi\FrameWork\Source\Client
-d E:\java\rmi\FrameWork\Source DemoClient_1.java
javac
-classpath E:\java\rmi\FrameWork\Source
-d E:\java\rmi\FrameWork\Source
Client.DemoClient_1.java//
-classpath <path> Specify where to find user class files
-d <directory> Specify where to place generated class files