runtime property

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aldsaldrin
    New Member
    • Nov 2008
    • 31

    runtime property

    How do I set a runtime property like com.project.new .xmlComposite to true? I keep getting an error when I execute a batch file and that I need to set runtime property com.project.new .xmlComposite to true. How do I that? Sorry if my questions seems a bit confusing, Im quite confused myself. Any help/suggestion/comments is greatly appreciated.

    Many thanks,
    Aldrin
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by aldsaldrin
    How do I set a runtime property like com.project.new .xmlComposite to true? I keep getting an error when I execute a batch file and that I need to set runtime property com.project.new .xmlComposite to true. How do I that? Sorry if my questions seems a bit confusing, Im quite confused myself. Any help/suggestion/comments is greatly appreciated.
    If that 'runtime' property is a system property you can either set it from the command line like this:

    Code:
    java -Dcom.project.new.xmlComposite=true YourApplication
    ... or you can set it near the top of your application like this:

    Code:
    public static void main(String[] args) {
       System.setProperty("com.project.new.xmlComposite", "true");
       // the rest of your code here ...
    }
    kind regards,

    Jos

    Comment

    • aldsaldrin
      New Member
      • Nov 2008
      • 31

      #3
      Hi Jos,

      I set the runtime property in the command line just like what you said but a NoClassDefFound Error is occuring. I also set the runtime property to where the java class is located but still it could not find the class. What folder do you think I should set that?

      Many thanks,
      Aldrin

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by aldsaldrin
        Hi Jos,

        I set the runtime property in the command line just like what you said but a NoClassDefFound Error is occuring. I also set the runtime property to where the java class is located but still it could not find the class. What folder do you think I should set that?

        Many thanks,
        Aldrin

        Lemme guess ... erm ... I don't know where you have stored your classes (possibly in .jar files). You were supposed to set that property to 'true' but you also have to set the classpath to where your classes are stored.

        kind regards,

        Jos

        Comment

        • aldsaldrin
          New Member
          • Nov 2008
          • 31

          #5
          Hi Jos,

          I set the classpath to the jarfile where the classes are stored but when I still use this command java -Dcom.project.ne w.xmlComposite= true ProjectClass, it still can't find class ProjectClass. Did I miss something?

          Many thanks,
          Aldrin

          Comment

          • JosAH
            Recognized Expert MVP
            • Mar 2007
            • 11453

            #6
            Originally posted by aldsaldrin
            Hi Jos,

            I set the classpath to the jarfile where the classes are stored but when I still use this command java -Dcom.project.ne w.xmlComposite= true ProjectClass, it still can't find class ProjectClass. Did I miss something?
            I don't know what the value of your classpath variable is; can you show it here?

            kind regards,

            Jos

            ps. better set that classpath variable on the command line by using the -cp flag.

            Comment

            Working...