I'm a newbie...
I'm using JDeveloper to build a desktop app, as a jar file. I want to
make 2 deployment profiles, one for Development and one for
Production. I would like it to set a constant somewhere that equals 1
for production and 0 for dev... In C++ I could set it up to include
different .h header files. How can I do that in Java? Or, what's a
best-practice for injecting different values into prod vs. dev code,
and having that set in the deployment profile so I can easily deploy
one or the other?
Thanks.
Shelves
Lew - 17 Jul 2007 04:28 GMT
> I'm a newbie...
>
[quoted text clipped - 6 lines]
> and having that set in the deployment profile so I can easily deploy
> one or the other?
Google for "Java property files" and "deployment descriptors".
--
Lew
Shelves - 18 Jul 2007 00:56 GMT
> > I'm a newbie...
> >
[quoted text clipped - 11 lines]
> --
> Lew
Thanks Lew. A property file should work. Do have to use Ant to
accomplish this?
Lew - 18 Jul 2007 02:38 GMT
> A property file should work. Do have to use Ant to accomplish this?
No.

Signature
Lew
Roedy Green - 17 Jul 2007 08:07 GMT
>In C++ I could set it up to include
>different .h header files. How can I do that in Java? Or, what's a
>best-practice for injecting different values into prod vs. dev code,
>and having that set in the deployment profile so I can easily deploy
>one or the other?
You could use an ant script to copy Variant1.java or Variant2.java
onto Variant.java and do a clean compile.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com