wood burning stoves 2.0*
The moose likes IDEs, Version Control and other tools and the fly likes How to modify source file in Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "How to modify source file in Eclipse" Watch "How to modify source file in Eclipse" New topic
Author

How to modify source file in Eclipse

K DeLucia
Ranch Hand

Joined: Apr 11, 2008
Posts: 68
I need to modify a portlet/war file. I have the source code. In Eclipse I opened the appropriate .java file and made a change to one parameter (I need to change a default URL hard-coded into the portlet). I'd like to now somehow repackage the code into a new war file with my changes but can't quite figure out how.

Should I import the code (with the edited .java file) into Eclipse, then export it as a war? I tried that, but when I try to deploy it in JBoss it doesn't show in the list of available portlets like it did before I messed with it. I have restarted JBoss. I may not have imported all the right stuff, or maybe not into the right place. I'm not even sure that's what I should do.

Any pointers are much appreciated.
K
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38481
    
  23
Don't know.

Sounds more complicated than the average beginner's question. In case there is an Eclipse-specific trick, I shall try moving you to the IDEs forum.
BV Boose
Ranch Hand

Joined: Jul 26, 2008
Posts: 33
I would use an ant build to generate a .war file. You could generate it with a tomcat plugin- is that even available anymore?
here's a start:
http://arkblog.wordpress.com/2008/01/08/creating-a-deployable-war-file-from-eclipse-project/
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

In Eclipse, you can create a "Dynamic Web Project". This project knows how to build WAR files and creates directories you can use for your JSPs.

You can also create a JBoss server within Eclipse, and link your web project to that server and Eclipse will handle the deployment.

Also, if you are doing development for JBoss AS, you can get JBoss Tools which is a set of plugins that help with app development.


JBoss In Action
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to modify source file in Eclipse