function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
aa143aa143 

unable to integrate with java to salesforce

1. setup for java environment and eclipse working fine


2. Navigate to http://mvnrepository.com/artifact/com.force.api/force-wsc in your browser and
download the WSC pre-built .jar file that matches the API version of Salesforce you’re using.

3. WSC uses the Rhino JavaScript framework, so if you don’t have this installed, navigate to
https://developer.mozilla.org/en-US/docs/Rhino/Download_Rhino and download the latest
.zip file. Un-archive the .zip file and move the folder to a location you’ll remember.

4. Generating Java Stub Files (WSDL-based APIs)
  
   develop-->api-->downloaded wsdl file.

Trying in command prompt:



But getting in an error


C:\>java - classpath F:\11\pathToJAR\wsc-23.jar com.sforce.ws.tools.wsdlc F:\11\pathToWsdl\enterprise.wsdl? F:\11\enterprise_stub.jar
Exception in thread "main" java.lang.NoClassDefFoundError: û
Caused by: java.lang.ClassNotFoundException: û
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: GÇô.  Program will exit.
Vinita_SFDCVinita_SFDC
Hello,

Please verify you code from following link to check if you are missing any step:

http://www.salesforce.com/us/developer/docs/api_meta/Content/meta_quickstart_java_sample.htm