I am getting error when I am compiling xmlbeans : java io.ioexception cannot run the program "javac"

StackOverflow https://stackoverflow.com/questions/14598564

  •  06-03-2022
  •  | 
  •  

Frage

I am trying to run a sample of xmlBeans to compile a xsd and create a jar corresponding to that but I am getting this error again & again

java.io.Exception: Cannot run program "filelocation\javac": CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessBuilder.start
    ............

It might be related to my "path" or "classpath" environment variable. Please suggest something.

War es hilfreich?

Lösung

I found the solution to the issue

I was using a command

scomp -out automobile-policy.jar automobile-policy.xsd

but there was some problem with the javac location in the path variable i guess

So I gave this command

scomp -compiler "c:\Program Files\Java\jdk1.6\bin\javac.exe" -out automobile-policy.jar automobile-policy.xsd

and it gave the desired automobile-policy.jar at the location.

Please note that the location of the javac.exe might be different.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top