-1

I am new to java application programming. wondering how to import package? I am using Eclipse.

import java.io.IOException;
import java.net.MalformedURLException;
import se.kontoret.testapi.*;  //this is required.

Is it same like dll file in .net where one must have .dll files and add as reference?

mrd
  • 2,095
  • 6
  • 23
  • 48

2 Answers2

1

There are two ways to do this:

  1. Downloaded the external library which is of .jar extension and Configure it using build path for a normal java project
  2. You can create a Maven project and add the dependencies there so that Maven will download it to your .m2 repo and you can import it in your code.
1

Yes, it is similar.

To do this, right click on your project, navigate to Build Path -> Add external archives, and then select the .jar file which contains your external dependency.

kutschkem
  • 7,826
  • 3
  • 21
  • 56