abhishekbunty / sfdc-wsc

Automatically exported from code.google.com/p/sfdc-wsc
0 stars 0 forks source link

WSC 22.0 (JDK 1.5) not working for compile target jdk 1.5 #42

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run: C:\SFDC\API_java>java -classpath wsc-22-jdk-1-5.jar 
com.sforce.ws.tools.wsdlc enterprise.wsdl enterprise.jar

What is the expected output? What do you see instead?
Expected: Compile & generation of enterprise.jar successful.

Instead: 
C:\SFDC\API_java>java -classpath wsc-22-jdk-1-5.jar com.sforce.ws.tools.wsdlc 
enterprise.wsdl enterprise.jar
[WSC][wsdlc.run:312]Created temp dir: C:\Users\user\AppData\Local\Temp\wsdlc-te
mp-1058389390010706246-dir
[WSC][wsdlc.<init>:79]Generating Java files from schema ...
[WSC][wsdlc.<init>:79]Generated 489 java files.
[WSC][wsdlc.compileTypes:262]Compiling to target 1.6...
javac: invalid target release: 1.6
Usage: javac <options> <source files>
where possible options include:
  -g                         Generate all debugging info
  -g:none                    Generate no debugging info
  -g:{lines,vars,source}     Generate only some debugging info
  -nowarn                    Generate no warnings
  -verbose                   Output messages about what the compiler is doing
  -deprecation               Output source locations where deprecated APIs are u
sed
  -classpath <path>          Specify where to find user class files
  -cp <path>                 Specify where to find user class files
  -sourcepath <path>         Specify where to find input source files
  -bootclasspath <path>      Override location of bootstrap class files
  -extdirs <dirs>            Override location of installed extensions
  -endorseddirs <dirs>       Override location of endorsed standards path
  -d <directory>             Specify where to place generated class files
  -encoding <encoding>       Specify character encoding used by source files
  -source <release>          Provide source compatibility with specified release

  -target <release>          Generate class files for specific VM version
  -version                   Version information
  -help                      Print a synopsis of standard options
  -X                         Print a synopsis of nonstandard options
  -J<flag>                   Pass <flag> directly to the runtime system

Error: Failed to compile

What version of the product are you using? On what operating system?
JDK: 1.5
OS: Windows 7 Professional

Please provide any additional information below.
This issue is happening in the downloaded file WSC 22.0 (JDK 1.5) in the 
Downloads section, and also setting the property compileTarget=1.5, directly in 
the build file and in the command line as: ant -DcompileTarget=1.5 all
Neither option worked.

Original issue reported on code.google.com by erodrig...@msights.com on 6 Jul 2011 at 10:27

GoogleCodeExporter commented 9 years ago
Did you try:

java -DcompileTarget=1.5 -classpath wsc-22-jdk-1-5.jar 
com.sforce.ws.tools.wsdlc enterprise.wsdl enterprise.jar

From the code, this should work. I didnt try it out.

       public void compile(String[] files) throws ToolsException {
            String target = System.getProperty("compileTarget");
            if (target == null) {
                target = "1.6";
            }

Original comment by manoj.ch...@gmail.com on 6 Jul 2011 at 10:34

GoogleCodeExporter commented 9 years ago
Yes, that worked!

Thanks.

Original comment by erodrig...@msights.com on 6 Jul 2011 at 10:39

GoogleCodeExporter commented 9 years ago

Original comment by jesperudby on 8 Feb 2013 at 7:47

GoogleCodeExporter commented 9 years ago
Can you please tell me where we have above code. I have wsc-22-jdk-1.7.jar 
file. I have extracted this jar using 7zip. 

I am getting the following error.
D:\wsdl>java -classpath wsc-22-jdk-1.7.jar com.sforce.ws.tools.wsdlc 
enterprise.wsdl enterprise.jar
[WSC][wsdlc.run:312]Created temp dir: 
C:\Users\SukumarM\AppData\Local\Temp\wsdlc-temp-8434733771251972742-dir
[WSC][wsdlc.<init>:79]Generating Java files from schema ...
[WSC][wsdlc.<init>:79]Generated 447 java files.
[WSC][wsdlc.compileTypes:262]Compiling to target 1.6...
javac: target release 1.6 conflicts with default source release 1.7
Error: Failed to compile

Please tell me whether the above solution works for me or not. If above 
solution works for me, tell me where I will find that code to change target 
release

Original comment by sukumar....@gmail.com on 13 Sep 2013 at 11:18