469,287 Members | 2,540 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,287 developers. It's quick & easy.

"javac": CreateProcess error=2. Please Help!

dmjpro
2,476 2GB
Hi ....
I am trying to compile my generated Java code.
Then I am getting an error .... "javac": CreateProcess error=2.
The command is ...
javac -d C:/Converter/Webapps_Source_Files/Sample/web/WEB-INF/classes -classpath C:/Converter/spring_library/spring.jar;
C:/Converter/spring_library/servlet-2.2.jar;C:/Converter/Webapps_Source_Files
/Sample/web/WEB-INF/classes C:/Converter/Webapps_Source_Files/Sample/src/java/org/iitkgp/erp/controllers
/ViewJSP.java

I am running it ... in Console, it's running perfectly.But whenever I trying to do it with Runtime.exec(command) then I am getting this error.

Please help!

Debasis Jana.
Mar 18 '08 #1
9 14537
JosAH
11,448 Expert 8TB
Don't do it that way: read about the ToolProvider class and the JavaCompiler
interface (you need Java 1.6 for them).

kind regards,

Jos
Mar 18 '08 #2
dmjpro
2,476 2GB
Don't do it that way: read about the ToolProvider class and the JavaCompiler
interface (you need Java 1.6 for them).

kind regards,

Jos
I am buliding a Code Converter Tool where I am generating some Java files and compiling those files.
I tried it in my machine after changing the path in Windows Environment.
It was running fine.
But now I am runing in different machine after changing the path.
The path is set correctly because it's running from console fine ...
Please help.

Debasis Jana.
Mar 18 '08 #3
JosAH
11,448 Expert 8TB
I am buliding a Code Converter Tool where I am generating some Java files and compiling those files.
I tried it in my machine after changing the path in Windows Environment.
It was running fine.
But now I am runing in different machine after changing the path.
The path is set correctly because it's running from console fine ...
Please help.

Debasis Jana.
The "CreateProcess: error = 2" means that the ProcessBuilder can't find your
executable file. You have to check your path. The tip I gave you doesn't need
that executable file javac.exe (which simply tries to fire up another jvm; javac is
written in java itself, remember?) But feel free to ignore my tip.

kind regards,

Jos
Mar 18 '08 #4
dmjpro
2,476 2GB
The "CreateProcess: error = 2" means that the ProcessBuilder can't find your
executable file. You have to check your path. The tip I gave you doesn't need
that executable file javac.exe (which simply tries to fire up another jvm; javac is
written in java itself, remember?) But feel free to ignore my tip.

kind regards,

Jos
How silly I am ....
Every time i ignore your tip.
Sorry I ll see it ....

Debasis Jana.
Mar 19 '08 #5
r035198x
13,262 8TB
Every time i ignore your tip.
Finally .
Mar 19 '08 #6
satch
23
The "CreateProcess: error = 2" means that the ProcessBuilder can't find your
executable file.
Jos
Hey Jos,
I also got this error the other day. Basically an IOException was thrown and this appeared as the message. So I looked at the doc for IOException but couldn't find anything related.
this should be there in the java docs...right? And if it is there in the java doc, where will I find it?
Mar 19 '08 #7
JosAH
11,448 Expert 8TB
Hey Jos,
I also got this error the other day. Basically an IOException was thrown and this appeared as the message. So I looked at the doc for IOException but couldn't find anything related.
this should be there in the java docs...right? And if it is there in the java doc, where will I find it?
I didn't find it in the API docs either so I experimented a bit and tried to start
something non-existent such as "foobar"; then this error came up; I guess
it's an OS completion code which is returned by a native method 'create' in
a ProcessImpl class (which extends the Process class) so I lost track there.

kind regards,

Jos
Mar 19 '08 #8
satch
23
I didn't find it in the API docs either so I experimented a bit and tried to start
something non-existent such as "foobar"; then this error came up; I guess
it's an OS completion code which is returned by a native method 'create' in
a ProcessImpl class (which extends the Process class) so I lost track there.

kind regards,

Jos
Ok.
Btw I also did a similar experiment, after fixing the problem by guess work :)
Mar 19 '08 #9
r035198x
13,262 8TB
Ok.
Btw I also did a similar experiment, after fixing the problem by guess work :)
I guess great minds think alike ...
Mar 19 '08 #10

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by King W.Wang | last post: by
15 posts views Thread by D E | last post: by
reply views Thread by Steven Buroff | last post: by
1 post views Thread by joecch | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.