0

I have no issues with opening other JARs but I cannot open 2 JARs with 2 Salesforce JDBC drivers.

When I double click on it, nothing happens. If I use 'java -jar jar_file_name.jar', there is an error 'no main manifest attribute'. And this is not my Java code, that's just JAR, so I cannot add this main manifest attribute. Please let me know what I can do to open such files and to use Salesforce JDBC drivers without any issues.

1 Answers1

0

A main manifest attribute is only needed for an executable Java application. A JDBC driver JAR is a library, and as such doesn't need to be executable1. Trying to run a JDBC driver using java -jar <jdbc-driver.jar> is not normal.

Instead, you need to add the JAR file to the class path of the application you're using. How exactly you add a JAR file to the class path depends on the application that needs to use the library, check its documentation.

See also What is a classpath and how do I set it?


1) some JDBC drivers do have a main manifest attribute, but that either runs a small program informing you that you shouldn't run the driver, but add it to a class path, or provides a simple diagnostic tool

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197