简体   繁体   English

如果我有eclipse,是否需要安装Java SDK?

[英]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.

相关问题 如果已经安装了JDK和JRE,是否需要为Eclipse Neon安装Java插件? - Do I need to install Java plugins for Eclipse Neon if I already have JDK and JRE installed? 为什么我需要安装Java才能安装JavaEE6 SDK? - Why do I need Java installed to install the JavaEE6 SDK? 即使安装了netbeans 7.2(完整包),我还需要安装Java EE6 SDK吗? - Do i need to install Java EE6 SDK even after i have installed netbeans 7.2 (complete package)? 如何在Ubuntu上安装Eclipse和Java SDK? - How can I install Eclipse and Java SDK on Ubuntu? 我需要在最终用户计算机上安装什么才能运行我用 Eclipse 制作的 Java 应用程序 - What do I need to install on the end users computer to run my Java application made with eclipse 我必须安装什么版本的Java? - What version of Java do I have to install? 如果您安装了Eclipse的Google插件,是否还需要下载App Engine Java SDK? - If you install the Google Plugin for Eclipse, do you still need to download the App Engine Java SDK? 如何在OSX上安装Java SDK的早期版本 - How do I install an earlier version of Java SDK on OSX 我是否需要在Eclipse中编译.java文件才能运行应用程序? - Do i need to compile .java files in Eclipse to run application? 我需要安装sqlite软件才能在Java中连接吗? - do I need to install sqlite software to connect in java?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM