开发者

Import classes In Java

I can't manage to plug in an external resources that I need to use in my code in java using Eclipse.

perhaps someone will know what seems to be the problem.

I have a zip file, I'm clicking on the project than press "Build path"--> External Archives and choose my 开发者_StackOverflow中文版file, than In the head of the code I write "import.....".

It says that the "The import cannot be resolved".

Is this the right way to plug in external classes?

Thanks


A Zip File is an unusual means of distributing Java Classes (it's possible, but unusual). My guess is that your Zip file contains the JARs you need, so you'd have to unpack the zip file first.


Open the .zip file first and if it contains the necessary .jar files then extract them and add them to your project.

It might also be possible that while downloading the .jar file it must have been saved as .zip

To check this open the zip file and see if it contains a META-INF directory with a MANIFEST.MF file within it.

In such a case rename the .zip extension of the file to .jar and add it to your project

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜