1

I have JDBC driver connected to my Eclipse project. According to MS manual I need to set claspath for JDBC. How to do this in Eclipse? I suppose it should be somewhere in run configuration, but I can't find it. Where I can set classpath in Eclipse?

I need to set CLASSPATH environment variable and not just add jar file. I can connect to SQL server from my project while LOG4J library can't. I suppose since it loads driver at runtime.

8
  • I don't need to set jar files location, I need to set CLASSPATH run time environment variable Commented Jul 5, 2018 at 15:12
  • you add jars to the classpath. In your case it would be JDBC's jar. PS- Use build tool like maven/gradle. Commented Jul 5, 2018 at 15:14
  • I'm using maven and log4j and JDBC driver are added. Projects compiles, but run complains log4j:ERROR Failed to excute sql java.sql.SQLException: No suitable driver found for "jdbc:sqlserver://localhost:1433;databaseName=ERP_IDMS" Commented Jul 5, 2018 at 15:22
  • see stackoverflow.com/questions/5616898/… Commented Jul 5, 2018 at 15:26
  • @Shanu Gupta this is not the same issue. I can connect to SQL server from my project while LOG4J library can't. I suppose since it loads driver at runtime Commented Jul 5, 2018 at 15:29

1 Answer 1

1

Project menu -> Properties -> Java Build Path

You can add .jar files to your classpath in the Libraries tab

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.