[英]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. 我已经使用Eclipse 2周了,所有程序都运行正常。
But I have realized that I have not specifically installed Java SDK. 但我意识到我没有专门安装Java SDK。
Is it normal or does Eclipse have its own compiler? 它是正常的还是Eclipse有自己的编译器?
I need to test the JDBC MySQL connector and now I don't know where to copy that file because in my: 我需要测试JDBC MySQL连接器,现在我不知道在哪里复制该文件,因为在我的:
C:/programfiles/java
I have only one directory that is JRE 6. 我只有一个目录是JRE 6。
Yes you're right. 你是对的。 Eclipse has its own compiler so you don't need JDK if you are working with Eclipse. Eclipse有自己的编译器,因此如果您使用Eclipse,则不需要JDK。
There is some cases/plugins that are only working with JDK such as Maven. 有些情况/插件只能与JDK一起使用,例如Maven。 So if you are planning to use Maven (either from Console or from Eclipse) you will need to download JDK . 因此,如果您计划使用Maven(来自Console或Eclipse),则需要下载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. 对于您的mysql连接器,通常的做法是将jar复制到项目目录(或者可能在lib目录下)并将其添加到构建路径。 Once the jar is in the location, you can refresh the workspace, right click, and select Build Path, add to Build Path. 一旦jar位于该位置,您可以刷新工作区,右键单击,然后选择Build Path,添加到Build Path。
You can download Eclipse with a bundled JRE, which is probably what you've done. 您可以使用捆绑的JRE下载Eclipse,这可能就是您所做的。 But since it has its own compiler etc, it doesn't need the full JDK. 但由于它有自己的编译器等,它不需要完整的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. 但是,您不需要JDK来使用mysql驱动程序,只需将其添加到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. 一些文档建议将JAR文件放在JRE / JDK的扩展目录中,但这是一个非常糟糕和过时的想法 - 不要这样做。 Use the classpath, via Eclipse's environment. 通过Eclipse的环境使用类路径。
Eclipse has its own compiler and can run on a non-JDK JRE. Eclipse有自己的编译器,可以在非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. 使用库jar的常用方法是将其复制到Eclipse内的Eclipse项目中,然后右键单击 - 将其添加到Build Path。 The classes are then accessible to your own code. 然后可以使用您自己的代码访问这些类。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.