How to use a class from JAR in eclipse

后端 未结 4 630
温柔的废话
温柔的废话 2021-02-10 07:36

I have two jar files - jar1 and jar2. Both of them are located in C:\\Eclipse projects\\ and I have added the paths to both of them to the Environment Variable CLASSPATH as foll

4条回答
  •  Happy的楠姐
    2021-02-10 07:56

    If you have a folder with your JAR files into the project:

    1. Right click on the project>Build Path>Configure Build Path;
    2. At the tab "Libraries" click on Add JARs, search and select the JARs files you want to use.

    If you have yours JAR files any other place outside the project:

    1. Right click on the project>Build Path>Configure Build Path;
    2. At the tab "Libraries" click on Add External JARs, search and select the JARs files you want to use.

提交回复
热议问题