|
Re: Creating a .jar file [message #520321 is a reply to message #520295] |
Thu, 11 March 2010 22:19 |
|
Maybe your import is wrong.
If you are trying to import a class from inside a package you can add the class name to the import directive as:
import verkiezingen. StemmachineException;
or import the whole package:
import verkiezingen.*;
Or alternatively you can use Eclipse`s power to do that for you by coding normally and then going to the menu:
Source > Organize Imports
|
|
|
|
|
|
Re: Creating a .jar file [message #520567 is a reply to message #520552] |
Fri, 12 March 2010 20:21 |
|
The project name is not a package. And you can't import classes from the default package (no name) from inside a jar file. You can read more about that here: http://dev.eclipse.org/newslists/news.eclipse.tools.jdt/msg1 1016.html
To create the package you can right-click your src folder and choose New ... > Package
Set the name you want to it and then just drag you class into it. Eclipse will automatically refactor, adding the package declaration.
Adding the package declaration manually doesn't work because the file must be inside the folder structure that the package represents.
|
|
|
|
Powered by
FUDForum. Page generated in 0.04358 seconds