2012年1月26日星期四

Importing a JAR file with eclipse - Dev Shed

Importing a JAR file with eclipse - Dev Shed

In project explorer right click on the folder/package where you want to import the JAR. Then choose "Import". In the import wizard, select General > File system. Browse for the JAR and select it.

Now you imported the JAR, but before you can use it, you need to add it to the classpath. Once again in project explorer right click on the project root folder, select Properties. In the properties menu select Java Build Path. In Java Build Path open the libraries tab and click on "Add JARs..." and browse for the JAR you just imported.

If you do not wish to actually import the package to your project but just use it, then you can skip the first part of this instruction and directly go to the "Libraries" tab in the Java Build Path. This time you should click on "Add external JARs..." and browse for the JAR in your file system.

没有评论: