The Java jar file "sqljdbc42.jar" couldn't be launched. Check the console for possible error messages

I was using SQL to query MySQL database, and for that, I had to install the jdbc driver, which I did using the 'sqljdbc42.jar' file. Earlier everything was working fine, but since I have formatted my system, and upgraded it to MacOS Sierra, whenever I try to launch a jar file, I see the mentioned msg in the pop-up (screenshot attached)



User uploaded file

MacBook Pro, macOS Sierra (10.12.4)

Posted on May 14, 2017 12:08 PM

Reply
4 replies

May 14, 2017 1:37 PM in response to ayush0704

Installing Sierra will disable Java.

You can install the legacy Java 6 version from Apple: Java SE 6


Or, you can install a Java Development Kit (JDK) from Oracle (not Java.com).

However, I don't know if it will install a Jar Launcher, but you can still launch one using the command line with

java -jar file.jar


Unless you are accessing MySql from a Java program, there is no need to use the JDBC. You can query MySql from the command line (Terminal) or from the MySql Workbench: https://dev.mysql.com/downloads/workbench/

There are other front ends for MySql.

I was using SQL to query MySQL database,

I'm not sure what that means as SQL is the language used in most relational database systems such as MySql. It is not a specific product. If you are using a Java-based program to access MySql, then you would need the JDBC.

May 15, 2017 2:16 AM in response to Barney-15E

Hi,

I have installed the workbench from the given link. Now I need to connect to the database, for which I have following information, along with the username and password. How do I proceed further? I tried to connect to the database with below information,

- jdbc:jtds:sqlserver://<hostname>:<port>;DatabaseName=<databasename>

but it's throwing the below error

Error - Lost connection to MySQL server at 'waiting for initial communication packet', system error: 60

I have selected Standard (TCP/IP) under the connection method

May 15, 2017 6:25 AM in response to ayush0704

You are trying to connect via JDBC still, but that connection string seems to be for SqlServer (Microsoft) not MySql. Are you sure it is a MySql database?


For MySql Workbench, add a new Connection using the Hostname and Port, and your username and password.

Use Standard TCP/IP for the connection method. However, if it is really a SqlServer database, that won't work.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

The Java jar file "sqljdbc42.jar" couldn't be launched. Check the console for possible error messages

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.