error in running java file using another java file -


i trying run java file using java file in windows....and code:

private static void printlines(string name, inputstream ins) throws exception {     string line = null;     bufferedreader in = new bufferedreader(         new inputstreamreader(ins));     while ((line = in.readline()) != null) {         system.out.println(name + " " + line);     }   }    private static void runprocess(string command) throws exception {       string s=system.getproperty("user.dir");       s="c:\\users\\hp\\downloads\\apache-tomcat-7.0.54-windows-x64\\apache-tomcat-7.0.54\\webapps\\mazil4.0\\web-inf\\classes";   file workingdir = new file(s);   system.out.println(q);   //new foo().nonstaticmethod(); process pro = runtime.getruntime().exec(command,null,workingdir);  printlines(command + " stdout:", pro.getinputstream()); printlines(command + " stderr:", pro.geterrorstream()); pro.waitfor(); system.out.println(command + " exitvalue() " + pro.exitvalue());    }     public static void mai(string[] args) {        string[] credentials=new string[4];int k=0;       (string s: args) {           system.out.println(s);         credentials[k]=s;k++;     if(k==4)     break;       }       try {       //runprocess("javac test2.java");         //thread foo=new thread();       runprocess("java mainclasses.emaildownload "+credentials[0]+" "+credentials[1]+" "+credentials[2]+" "+credentials[3]+" ");      } catch (exception e) {       e.printstacktrace();     }system.out.println("hi");   } 

i giving location of class using workingdir...and file path is:

c:\users\hp\downloads\apache-tomcat-7.0.54-windows-x64\apache-tomcat-7.0.54\webapps\mazil4.0\web-inf\classes\mainclasses\emaildownload.class 

package name mainclasses.but still gives error:

could not find or load main class mainclasses.emaildownload 

whay possibly reason?

in line:

public static void mai(string[] args) { 

is 'n' missing.

change

public static void main(string[] args) { 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -