I have trouble running a Java Applet (Java Webstart, jnlp) on the same desktop but different user; i think it's due to a lock mechanism (or something like that) of Java preventing two users to run the same JRE and especially the same applet.

Is there a way to install a separate instance of java on each user's directory ?

The desktop is running ubuntu latest 9.10


  • I found that the problem where in the /tmp directory; when starting an instance it will create a /tmp/.cache and store its data into it. Now i need that each instance have its own tmpdirectory; is it possible ? If so, shall i do it 'unix system wide' or 'java side' (i cannot modify the jars, it's hosted on some other site)
    – Disco
    Oct 9, 2009 at 14:45
  • You can try creating a world-read/writable /tmp/.cache and see if the two applets share it nicely. It may work great or you may see unwanted interactions. You may need to also share permissions on files inside that directory. There are Java testers and security checkers that attempt to better sandbox Java's interactions with the O/S. I'm not familiar with them, perhaps someone else who is can comment.
    – kmarsh
    Oct 12, 2009 at 12:46

2 Answers 2


Java is surely not the problem. The applet may be the problem, but not the applet itself, but some assumption that it makes, such as always using the same temporary file or locking the same writable file and then forgetting the lock.

Try reproducing the problem and then running lsof on the programs. You'll see lots of open libraries but you're looking for something on the user writable side (home dir, /tmp, /var/tmp) that has a fixed filename.

  • It's a forex client applet, i can't change the source (don't have access to it). But in 'general' can 2 users on the same desktop run the same applet at the same time ? is there a way to 'isolate' each process ?
    – Disco
    Oct 9, 2009 at 12:15
  • 2
    While each Java instance runs is its own sandbox, the system's network portmap and the filesystem both represent shared resources for user apps to conflict with each other. Even without source code, you can use lsof to debug the processes. There probably is some way to isolate each process, but you'll waste a lot of time trying if you don't first understand the nature of the conflict.
    – kmarsh
    Oct 12, 2009 at 12:43

As you know Java applet runs on the client site not on the server. So, are you saying the users are logged into the same machine where applet is hosted?

I mean, every user can install JRE in their home directories and update $PATH and $CLASSPATH variable but that is a maintenance nightmare. If, for example, Java code is updated and some method got deprecated then, you're asking the masses to upgrade to new JRE. Why not test it out using 5 user accounts or so and see how the applet behaves - maybe it will still freeze with those 5 users.

  • issue with /tmp/.cache/ directory being locked; check my comment above.
    – Disco
    Oct 9, 2009 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.