Any way to compile a java program with missing sources?

K

kahrayzee

Hi,

I am stuck maintaining an old product that is missing a large set of
the original source files. I need to make a tiny modification to a
section of code that I actually do have the accurate source for,
however I am unable to compile it without the entire classpath and all
setup. Is there perhaps some way to either trick javac into only
compiling this one file without rebuilding everything else with a
parameter to tell it not to do this?

I am getting a lot of "Cannot resolve symbol" errors. What I would
ultimately like to be able to do is to re-compile this one class and
then put it into the correct location in the .jar file and see if it
behaves properly. If anyone has any suggestions it would be greatly
appreciated.

Thanks,

Greg
 
A

Andrew Thompson

On Mar 29, 1:04 am, (e-mail address removed) wrote:
...
I am stuck maintaining an old product that is missing a large set of
the original source files. I need to make a tiny modification to a
section of code that I actually do have the accurate source for,

You can compile the source, using the existing
*classes* for reference. Simply ensure they are
on the classpath at time of compilation.

Andrew T.
 
I

Ingo R. Homann

Hi,

I am stuck maintaining an old product that is missing a large set of
the original source files. I need to make a tiny modification to a
section of code that I actually do have the accurate source for,
however I am unable to compile it without the entire classpath and all
setup. Is there perhaps some way to either trick javac into only
compiling this one file without rebuilding everything else with a
parameter to tell it not to do this?

I am getting a lot of "Cannot resolve symbol" errors. What I would
ultimately like to be able to do is to re-compile this one class and
then put it into the correct location in the .jar file and see if it
behaves properly. If anyone has any suggestions it would be greatly
appreciated.

Every Java programmer does this every day! (Or do you think, that
compiling a "Hello world"-Programm will re-compile the whole Java-API?)

The "trick" ist to setup the classpath correctly while compiling, that
means to let it point to your JAR file.

Hth,
Ingo
 

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,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top