简体   繁体   中英

Do I need to install Java SDK if I have eclipse

I have been using Eclipse for 2 weeks and all programs are working fine.

But I have realized that I have not specifically installed Java SDK.

Is it normal or does Eclipse have its own compiler?

I need to test the JDBC MySQL connector and now I don't know where to copy that file because in my:

C:/programfiles/java

I have only one directory that is JRE 6.

Yes you're right. Eclipse has its own compiler so you don't need JDK if you are working with Eclipse.

There is some cases/plugins that are only working with JDK such as Maven. So if you are planning to use Maven (either from Console or from Eclipse) you will need to download JDK .

For your mysql connector, a common practice is to copy the jar to your project directory (or maybe under lib directory) and add it to the build path. Once the jar is in the location, you can refresh the workspace, right click, and select Build Path, add to Build Path.

You can download Eclipse with a bundled JRE, which is probably what you've done. But since it has its own compiler etc, it doesn't need the full JDK.

You don't need the JDK to use the mysql driver, though, you just need to add it to your project classpath in Eclipse. Some documentation suggests putting JAR files in the JRE/JDK's extensions directory, but this is a profoundly bad and outdated idea - don't do that. Use the classpath, via Eclipse's environment.

Eclipse has its own compiler and can run on a non-JDK JRE.

The usual approach to use a library jar, is to copy it into your Eclipse project inside Eclipse, and right-click-add it to the Build Path. The classes are then accessible to your own code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM