473,394 Members | 1,022 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,394 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 15014
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.