Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2010
    Posts
    3
    Rep Power
    0

    Default Problem with static attributes

    Hi everyone! My name is Andre and I'm currently stuck with a problem I just can't figure out how to solve, so I though maybe you all could give me some hints.

    Basically, my problem is that I'm working on a project that requires me to run multiple instances of someone else's code which has many static attributes/variables, which causes all the instances to share those resources and, well, crash. I can run multiple instances of this other person's program if I create a .jar file off of it and open it multiple times by running the .jar in windows, but running calling the "main" method multiple times in my code (which is what I need to do) won't work.

    I thought about creating a .jar and using a Runtime.getRuntime().exec( "myprog.jar" ); to call the program multiple times, but that won't work for me since I have to pass an instance of my object to this new program and I don't think this solution would allow for that.

    Sorry if this comes as a rookie question, but I really have no idea of how to get around this...

    Thanks a lot and kind regards,
    André

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default

    Also posted on Sun forums.

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  4. #4
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

  5. #5
    Join Date
    Jan 2010
    Posts
    3
    Rep Power
    0

    Default

    Sorry... Like I said in the Java Forums, I didn't know this was against the forum's etiquette.

    I'll crosspost any useful replies I get.

  6. #6
    Join Date
    Jan 2010
    Posts
    3
    Rep Power
    0

    Default

    Some replies were posted on the Java Forums and StackOverflow, so I guess we could just keep the discussion there instead of crossposting in the 3 websites...

    Again, sorry about the crossposting, I had no idea it was agains the forum's etiquette.

Similar Threads

  1. Install4j - bundling a static JRE 1.6 problem
    By banderas in forum Java Software
    Replies: 0
    Last Post: 02-13-2009, 11:23 AM
  2. Usual problem: cannot make a static....
    By hendrix79 in forum New To Java
    Replies: 2
    Last Post: 12-15-2008, 04:19 PM
  3. Static Vector Problem
    By calicocal in forum New To Java
    Replies: 12
    Last Post: 11-10-2008, 12:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •