简体   繁体   中英

Create and import Java library in Eclipse

I have seen similar questions on SO and I'm just not getting it. I have a bunch of Java classes I need to import as a library. How do I make the jar file, save it in the right place, then tell Eclipse to import the jar file?

The classes I want in my library are here: StdIn library code

and this is the java code I want to import the library into: Sattolo algorithm code

There is a further library I would need to import to make the Sattolo algorithm run, but once I get the general idea...

I am a very, very new Java coder, so please be patient with me not understanding what must seem very basic.

Step 1: create a jar from you classes, if your using eclipse then simply https://www.cs.utexas.edu/~scottm/cs307/handouts/Eclipse%20Help/jarInEclipse.htm

Step 2: add the jar dependency to your eclipse project How to import a jar in Eclipse

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM