Reputation: 99
I made an Java application, that on some point opens a local directory or file. The program is located on a server (executed by an other desktop). When an existing folder/file is opened by the app (that is located on the server, and accesed remotely), no screen pops up. If i run the Java program on my desktop, the opening of the of the local folder/file works fine.
I think that the problem is that, when i call the "open folder/file function" i acces the desktop of the server. But the window needs to be openend by the "calling" pc. So i need to specify that the desktop of the calling computer should be used.
How can i accomplish this?
Here is the function that i use to open a folder/file:
try {
if (Desktop.isDesktopSupported()) Desktop.getDesktop().open(new File(path));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
the application is remotely accesed something like this: \\10.0.0.1\Java\App.jar
Upvotes: 1
Views: 1388
Reputation: 500
I suppose you are using Windows and your Server is mounted with an SMB share. Try to mount the remote server directory to a local drive letter like R:, this should solve access problems.
Upvotes: 1
Reputation: 517
If you access the Java application like this: \10.0.0.1\Java\App.jar you are still running the application from the local machine. In order for it to be run on the server you would have a Java process running on that server and then on the local machine you would have another Java application that is the client for the server application.
Upvotes: 3