Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Writing JAR from plug-in (not from File menu)(How to save project's .java files plus additional text file to JAR)
Writing JAR from plug-in (not from File menu) [message #1185045] Wed, 13 November 2013 21:36 Go to next message
Hannah Blau is currently offline Hannah BlauFriend
Messages: 3
Registered: November 2013
Junior Member
I'm writing a plug-in for Eclipse Standard/SDK Kepler to give diagnostic feedback to undergraduate student programmers as they work on their programming assignments. The student can run my plug-in as often as he wishes to see if his code triggers any messages about poor programming practices he might want to change. Each time the student invokes the plug-in, I need to save a JAR that includes all the .java files in the student's project as well as a text file containing the diagnostic feedback produced by the plug-in. I know the student can create a JAR using the File->Export->Java->JAR file option in Eclipse, but I want to create the JAR behind the scenes without asking the student to do anything more than choose a menu item to run the plug-in. I want to save the JAR to the directory that already holds the student's source files. I've been plowing through the documentation on Resources in the Platform Plug-in Developer Guide, so far without enlightenment. I would greatly appreciate any pointers you can offer.
Re: Writing JAR from plug-in (not from File menu) [message #1185562 is a reply to message #1185045] Thu, 14 November 2013 05:47 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Hannah,

Plug-in Spy can be very useful for finding how existing things in
Eclipse are implemented. E.g., you could open the export to archive
wizard and hit Alt-Shift-F1 to see which class implements that dialog.
Then you can look into how that source code is implemented and reuse the
ideas.

On 14/11/2013 2:00 AM, Hannah Blau wrote:
> I'm writing a plug-in for Eclipse Standard/SDK Kepler to give
> diagnostic feedback to undergraduate student programmers as they work
> on their programming assignments. The student can run my plug-in as
> often as he wishes to see if his code triggers any messages about poor
> programming practices he might want to change. Each time the student
> invokes the plug-in, I need to save a JAR that includes all the .java
> files in the student's project as well as a text file containing the
> diagnostic feedback produced by the plug-in. I know the student can
> create a JAR using the File->Export->Java->JAR file option in Eclipse,
> but I want to create the JAR behind the scenes without asking the
> student to do anything more than choose a menu item to run the
> plug-in. I want to save the JAR to the directory that already holds
> the student's source files. I've been plowing through the
> documentation on Resources in the Platform Plug-in Developer Guide, so
> far without enlightenment. I would greatly appreciate any pointers
> you can offer.
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Writing JAR from plug-in (not from File menu) [message #1189225 is a reply to message #1185562] Sat, 16 November 2013 01:41 Go to previous message
Hannah Blau is currently offline Hannah BlauFriend
Messages: 3
Registered: November 2013
Junior Member
Thank you for the suggestion. I also discovered after I posted my question that there is a section about writing a JAR file in the JDT Plug-in Developer Guide, under JDT UI. I guess I did not use the perfect search terms when I first looked for how to save a JAR file. Hannah
Previous Topic:ANT Eclipse get -data Workspace
Next Topic:Java Questions
Goto Forum:
  


Current Time: Tue Apr 23 14:01:08 GMT 2024

Powered by FUDForum. Page generated in 0.03372 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top