How to use a class from JAR in eclipse

后端 未结 4 610
温柔的废话
温柔的废话 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条回答
  •  说谎
    说谎 (楼主)
    2021-02-10 08:00

    In eclipse, right click on a project->Propeties->Java Build Path->Add External JARs (Add JARs if the jar is inside the project's folder) and then choose your jar file. From now you can use the inner classes of the jars you added. Eclipse will import them when you'll start using them.

提交回复
热议问题