473,326 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

"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 15006
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

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

Similar topics

0
by: King W.Wang | last post by:
Hi Java gurus, I've copied the following program from the book "Java by Examples". It compiles well with javac. But it does not run as expected. EXPECTED: It is expected that, when you input...
0
by: Phillip Montgomery | last post by:
Hello all; I'm trying to debug an issue with a java script called, SelectSockets. It appears to be a fairly common one found on the web. I downloaded the SGI Java v1.4.1 installation from SGI's...
15
by: D E | last post by:
Ok the subject line is basically the question. Obviously this won't work. What is the technical reason? Is it because here, "test1" is sort of like a static object now? What exactly is "test1"...
0
by: Steven Buroff | last post by:
I can't seem to get the @SuppressWarnings("unchecked") to work. Here is my test program. public class Tryit { @SuppressWarnings({"unchecked"}) public <T> T doit(Class<T> clazz){ T val =...
1
by: joecch | last post by:
If I have many jar files used to compile my java application, can I use wildcard (the example is shown below) in order to eliminating the full paths for each jar files that make the command clumsy? ...
0
by: maheshnew2007 | last post by:
Hi, I have simple Ant's build.xml file, which contains fork="yes". build.xml file: <?xml version="1.0"?> <project name="test" default="compile" basedir="."> <property name="src"...
8
by: pjerald | last post by:
package test; import java.util.ArrayList; public class MyArrayList{ public static void main(String args) { ArrayList al = new ArrayList(); al.add("Jerald"); ...
3
by: Ananthu | last post by:
Hi This is my codings in order to access mysql database from java. Codings: import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement;
0
by: rcreddych | last post by:
I am getting the following error while deploying a simple Java Stored Procedure. I am using db2 8 and using the IBM Data Studio. I am new to DB2. Your help will be apreciated. CHETR.PROCEDURE1 -...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.