tags:

views:

834

answers:

3
  1. JAXB 1.5 installed under C:\Sun\jwsdp-1.5
  2. J2SE 1.4.2 installed under C:\j2sdk1.4.2_08
  3. copied sample.xsd file to C:\Sun\jwsdp-1.5\jaxb\bin
  4. went to C:\Sun\jwsdp-1.5\jaxb\bin and ran xjc.bat -p com.package sample.xsd
  5. got error message: Unrecognized option: -p Could not create the Java virtual machine.

Please help me out, thanks a lot

+2  A: 

This page seems to indicate tha xjc.bat needs Java 1.5+ :

http://forums.sun.com/thread.jspa?threadID=5359378

Carsten
it is pretty old app. I am not allowed to make decision to move forward:((
dell
JAXB 2 requires Java 5, JAXB 1 works fine with pre-Java 5.
skaffman
This was the command issued: xjc.bat -p com.package sample.xsd and I had JAVA_HOME printed and got error C:\j2sdk1.4.2_08Unrecognized option: -pCould not create the Java virtual machine.
dell
A: 

The last JAXB version that is compatible with java 1.4.2 is JAXB 1.0.6. I've never heard of a version 1.5... Where did you get it?

Edit

This error message is not generated by jaxb but by the JVM. Looks like, the jvm thinks, the '-p' parameter is a jvm parameter. Here's another page where the same error message was generated at a simple java --version call.

And another explanation for the error.

Andreas_D
JWSDP 1.5 is a bundle of XML-related APIs, including JAXB 1.0. The version numbers are not comparable.
skaffman
Sorry, I am new to this area. I mean Java Web Services Developer Pack 1.5. and got it from http://java.sun.com/webservices/downloads/1.5/index.html
dell
So it's not JAXB 1.5 but some other version...
Andreas_D
A: 

Hi, I faced the similar problem and I resolved it using the following approach. I specified Jdk1.5 as the JDK while installing jwsdp1.5. But the system had jdk1.4 also installed. so I created the following batch file

set JAVA_HOME=D:\apps\BEA\Weblogic\jdk150_04 set ANT_HOME=H:\Sun\jwsdp-1.5\apache-ant set JWSDP_HOME=H:\Sun\jwsdp-1.5 set PATH=%JAVA_HOME%\bin;%PATH%; %JWSDP_HOME%\jaxb\bin\xjc -p package -dtd sample.dtd

This resolved the error. Alternatively we can remove the Jdk1.4 path in the PATH environment variable, in that case, we need to write the batch file.

Regards Mohan Babu

mohan babu