jar file from Eclipse at the root of the jar file rather than nestedin directories

W

wong_powah

When I generate a jar file from Eclipse v3.3.2, the classes are
ending up at the root of the jar file rather than nested in
directories
according to their package.
i.e.
The good jar created by the jar command had the path:
tar tvf MyJCASP.jar
com/mycomp/crypto/Key.class
....

The bad jar created by eclipse had not the path "com/mycomp/crypto":
tar tvf MyJCASP.jar
Key.class
....

These are my steps to create a jar file in Eclipse:
I create a new Java Project.
I set the workspace to C:\temp\eclipse\workspace.
My source files are at C:\win10\JavaSP\com\mycomp\crypto and
C:\win10\JavaSP\com\mycomp\crypto\X509
I create project "Same" and use "Import, File System, Filter Types,
Select
Types" menus to put the source files from
C:\win10\JavaSP\com\mycomp\crypto and
C:\win10\JavaSP\com\mycomp\crypto\X509 to C:\temp\eclipse\workspace
\Same.
I import the files starting lower down in the hierarchy (i.e. C:
\win10\JavaSP\com\mycomp\crypto) because there are other files C:
\win10\JavaSP\com\mycomp\cryptoext which are used to create another
jar.

In the Package Explorer view, the files are showing up at the root.
i.e. I do not see "com" nor "mycomp" nor "crypto" in the "src" and its
subdirectory.

Please help to make eclipse v3.3.2 to put the path in the jar file.
Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top