Deploy To Dev and Production

S

Shelves

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
 
L

Lew

Shelves said:
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?

Google for "Java property files" and "deployment descriptors".
 
R

Roedy Green

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.
 

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,994
Messages
2,570,223
Members
46,814
Latest member
SpicetreeDigital

Latest Threads

Top