I want to open Internet Explorer from Java in Windows server 2008. I searched online before posting but I still cant do it.
This is my code :
try {
Process p = Runtime.getRuntime().exec("cmd.exe /c start iexplore www.google.com");
p.waitFor();
} catch (IOException e) {
//log
} catch (InterruptedException e) {
//log
}
This works fine in a simple Java project I created on my laptop, but doesnt work in a java class I have in work on a windows server 2008.
The application is made using a CRM, the CRM offers the possibilty to add a button linked to a java class. once the button clicked, the java class is launched.
I tried making a windows batch file where I launch Internet explorer and then print something in a log file. When I click manually on the batch file, Internet explorer is launched and the log file created. But when I call the batch file from the Java class, the log file is created but internet explorer isnt launched.
The CRM is linked to a windows user member of the group 'administrators'.
Thank you for any help you can provide.
EDIT:
Like I said The CRM is linked to a windows user. I noticed in the windows task manager that after I click the button the process iexplore.exe is created, so the code works fine, but the process owner is the user linked to the CRM, and the not the one I use to log in, so I guess thats why it seems that the browser isnt launched.
Any clue to get around this ?
Thank you again.