Results 1 to 3 of 3
  1. #1
    tobalajia is offline Member
    Join Date
    May 2008
    Posts
    2
    Rep Power
    0

    Exclamation Getting error using XMLBeans to create jar file

    When using xmlbeans to create the jar file from xsd file i am getting error like this

    C:\PIE\Documents\Granite>scomp -out asf.jar msg.xsd
    Time to build schema type system: 0.579 seconds
    Time to generate code: 0.11 seconds
    java.io.IOException: Cannot run program "C:\PIE\Documents\Granite\javac": Create
    Process error=2, The system cannot find the file specified
    java.io.IOException: CreateProcess error=2, The system cannot find the file spec
    ified
    java.io.IOException: Cannot run program "C:\PIE\Documents\Granite\javac": Create
    Process error=2, The system cannot find the file specified
    at java.lang.ProcessBuilder.start(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at org.apache.xmlbeans.impl.tool.CodeGenUtil.external Compile(CodeGenUtil
    .java:231)
    at org.apache.xmlbeans.impl.tool.SchemaCompiler.compi le(SchemaCompiler.j
    ava:1154)
    at org.apache.xmlbeans.impl.tool.SchemaCompiler.main( SchemaCompiler.java
    :373)
    Caused by: java.io.IOException: CreateProcess error=2, The system cannot find th
    e file specified
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(Unknown Source)
    at java.lang.ProcessImpl.start(Unknown Source)
    ... 6 more
    BUILD FAILED

    Can you help how to resolve this error to create jar
    How to use Ant here?

  2. #2
    Join Date
    Aug 2008
    Posts
    2
    Rep Power
    0

    Thumbs up boss i am getting same error

    plzzzz let me know if u got any sollution

  3. #3
    Shazmiester is offline Member
    Join Date
    Aug 2008
    Posts
    1
    Rep Power
    0

    Default

    I found this solution on the Sun's Java forum

    do something like the following

    Java Code:
    scomp -out library.jar library.xsd -compiler "c:\Program Files\Java\jdk1.6.0\bin\javac.exe"
    worked for me.

    Edited:
    Actually moving jdk path in your PATH environment variable higher up will solve the problem entirely. You wouldn't need to specify the compiler after that. To see how to do that, go to XMLBEAN's website FAQ and search for "The scomp program can't find javac and fails with java.io.IOException on Windows!"

    P.S. I can't believe i am not allowed to post links until i've 20 posts???
    Last edited by Shazmiester; 08-14-2008 at 08:41 PM.

Similar Threads

  1. How to create a file
    By Alpha in forum New To Java
    Replies: 7
    Last Post: 01-06-2012, 07:10 PM
  2. reading from a zip file, error
    By Mr tuition in forum AWT / Swing
    Replies: 1
    Last Post: 01-16-2008, 12:39 AM
  3. File Write Error
    By vikain in forum Advanced Java
    Replies: 5
    Last Post: 01-02-2008, 04:38 AM
  4. Replies: 20
    Last Post: 12-17-2007, 03:20 PM
  5. Replies: 1
    Last Post: 07-24-2007, 12:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •