0

I have a java project loaded into IntelliJ IDEA. The code requires JDBC and so I downloaded and unzipped the sqljdbc_6.4.0.0_enu file into the recommended directory, "C:\Program Files\Microsoft JDBC Driver 6.4 for SQL Server". This creates the jar files:

  • mssql-jdbc-6.4.0.jre7.jar
  • mssql-jdbc-6.4.0.jre8.jar
  • mssql-jdbc-6.4.0.jre9.jar

in the directory, "C:\Program Files\Microsoft JDBC Driver 6.4 for SQL Server\sqljdbc_6.4\enu". And so, now, how do I make use of all this in my project in IntelliJ IDEA? And if I later put all my java code into Git Hub, how can I ensure that another user will have code that will compile and link? Will I have to include the .jar file in Git Hub somehow?

xarzu
  • 8,657
  • 40
  • 108
  • 160

2 Answers2

0

you should not do this. For your case, you can choose one of them:

  1. create lib foder into project folder - put .jar files in the folder- setup module with library point to the folder - commit metadata folder of IDEA such as .idea, {projectName}.iml (not recommend)

  2. The best solution is using maven or Gradle, you are able to put the dependencies which are neccessary into pom.xml file. (Recommend)

Mr Special
  • 1,576
  • 1
  • 20
  • 33
0

You can refer this for adding external jar files in IntelliJ IDEA.

As for GitHub, you can put your jar files there by removing *.jar from .gitignore configuration file. However this is not a recommended practice to have JAR files in repository as they've considerable size. You can consider using some build tool(maven or gradle) to add external dependencies.