Thanks for chiming in here Barney, and my apologies for the j-newb
questions.

I know I can redirect the java compiler output, and I also know that Eclipse
or Netbeans or jEdit can automate that. I'd like to get up to speed a bit
with Ant though, unless that seems to folks here like a really bad idea for
some reason.

Given that java files and class files can be in different locations and be
seen by cf, how do people set up their project directories when java's
involved?

In general, I'd like the java files to stay with the cf code they relate to,
then have Ant (or somebody) put the compiled class files wherever they need
to go. Ideally, the classes should be in a location that can reasonably be
mirrored on the production site for this project, ideally without adjusting
the cf admin class path. I wouldn't think that putting them in
WEB-INF/classes would be good from that perspective, since they're not
associated with their owning app.

Am I thinking about this wrong?

Dave Merrill


> First, you can use the -d flag to javac to output your .class files
> somewhere other than where you .java files are.  Any decent IDE will
> have a setting to do the same thing with it's compiler.  That'll let
> you save your .javas with your other source code, and automatically
> place the .class files in the right place.
>
> Second, there are two settings in jrun-web.xml that will let you put
> your .java files right in the WEB-INF/classes directory and JRun will
> take care of compiling them as needed.
> http://livedocs.macromedia.com/jrun/4/Getting_Started_with_JRun/in
> tro5.htm#1119380
>
> cheers,
> barneyb
>
> On 4/15/05, Dave Merrill wrote:
> > Thanks for replying, but I don't understand your answer. "No"
> you don't see
> > the problem, or "No" there's nothing that can be done about it?
> >
> > I also don't get what you mean about restarting cfmx or copying
> the class
> > file. First off, I still see this problem even *after*
> restarting cf, which
> > of course I'd rather not do after every modification to the java file.
> >
> > Second, for now I'm just recompiling the java in place, where
> it's called by
> > cf. If you're saying something about better workflow when
> working with java
> > files, I'm all ears; I figured I'd end up using Ant, like I
> understand most
> > java folks do, but I haven't set it up yet. But the problem I'm having
> > doesn't seem to have anything to do with copying of files. Am I
> > misunderstanding what you're saying?
> >
> > Dave Merrill
> >
> > > Dave:
> > > No! unless you are using jre that will required restart cfmx,
> otherwise,
> > > it is just copy the .class file to the bin
> > >
> > > I'm just starting to experiment with writing java classes for use
> > > in CF, and
> > > CF appears to be caching them more than I'd expect.
> > >
> > > Changes to java classes aren't reliably reflected in the
> browser, which
> > > makes learning and trying things very annoying. Sometimes
> restarting CF
> > > wakes it up, sometimes not, and sometimes I get that
> wonderful "<." msg,
> > > even though all that's changed is the value of a hard coded
> > > string returned
> > > by my test java class.
> > >
> > > Is this a problem other people see? Is there anything that
> would make this
> > > process more productive?
> > >
> > > The cf admin setting "Save Class Files" is unchecked. This is
> CFMX 61 on
> > > win2k, web server is IIS.
> > >
> > > Thanks,
> > >
> > > Dave Merrill




----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]


Reply via email to