Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / March 2005

Tip: Looking for answers? Try searching our database.

JAR files and Eclipse

Thread view: 
sashley - 15 Mar 2005 00:09 GMT
I want to do something simple in Eclipse, but I've searched high and
low and can't figure out how to do it.

I have created a project in Eclipse, which contains several .java files
and the resulting .class files. I have included extensive Javadoc
comments in the .java files, and many of those comments reference .gif
files, which I have included in the project. Generating a Javadoc
export creates the correct html files.

I want to create a JAR file which contains all the .class files and
nothing else.   No resources at all.

How do I do it?

Thanks
Alex Molochnikov - 15 Mar 2005 00:25 GMT
Right mouse-click on the project name in Package Explorer perspective.
Select Export and follow the wizard. One of the options in it will let you
select only .class files for exporting into the JAR.

Reading the on-line docs on Eclipse is also VERY beneficial.

> I want to do something simple in Eclipse, but I've searched high and
> low and can't figure out how to do it.
[quoted text clipped - 11 lines]
>
> Thanks
sashley - 15 Mar 2005 03:30 GMT
Been there, done that. When the JAR Export dialog box comes up, it
gives three choices:
"Export generated class files and resources"
"Export all output folder for checked projects"
"Export java source files and resources"
The first choice is the only one that comes close. But if you uncheck
each resource, the "Finish" button goes dark, implying that you have to
include at least one resource file with the .class files.

I read the online documents but didn't find the answer there. If I
overlooked something in the online documents, please don't hesitate to
direct me to the correct page.

Thanks
ninhoa@yahoo.es - 15 Mar 2005 16:18 GMT
> Been there, done that. When the JAR Export dialog box comes up, it
> gives three choices:
[quoted text clipped - 10 lines]
>
> Thanks

The 'Finish' button never goes dark (at least for my Eclipse 3.0) as
long as you keep one (or more) .java files or resources selected. The
generated jar will contain the compiled classes.
Alex Molochnikov - 15 Mar 2005 17:32 GMT
> Been there, done that. When the JAR Export dialog box comes up, it
> gives three choices:
[quoted text clipped - 4 lines]
> each resource, the "Finish" button goes dark, implying that you have to
> include at least one resource file with the .class files.

"Export generated class files and resources" is what you need. The list of
resources to export can be tuned manually; check only .java files, and
ignore everything else. You JAR file will contain only .class files.

> I read the online documents but didn't find the answer there. If I
> overlooked something in the online documents, please don't hesitate to
> direct me to the correct page.

Help > Help Contents
Type "export" in the Search field.
Read up on the Export Wizard, JAR file export etc.

> Thanks


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.