Deploying for different purposes

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. In C++ I would do this by setting a prefix file in the IDE to include different .h header files that would define anything I wanted, like for the platform, debug, development, etc. 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.

Bob

[552 byte] By [SunnyBoba] at [2007-11-27 10:50:39]
# 1

You could set such things as system variables

public class SystemVariablesDemo{

public static void main(String[] args) {

String debug = System.getProperty("debug");

System.out.println("value of 'debug' is " + debug);

}

}

... later that day, on the command-line

java SystemVariablesDemo -Ddebug=true

value of 'debug' is true

Should give you an idea

georgemca at 2007-7-29 11:26:34 > top of Java-index,Desktop,Deploying...
# 2

Thanks for the idea George. But, I really want to have it all within the jar and not dependent on anything else.

SunnyBoba at 2007-7-29 11:26:34 > top of Java-index,Desktop,Deploying...
# 3

So you effectively want 2 jars, one with one profile and one with another? Define the variables (debug, etc) in a properties file, stick the relevant properties files in the relevant jars and load them at runtime

Hope that's clear enough

georgemca at 2007-7-29 11:26:34 > top of Java-index,Desktop,Deploying...