This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have Win XP SP2 with JDK 1.6 installed with proper path setting.My problem I have created an executable JAR file and it working fine in another PC with same coniguration(XP2 and JDK1.6),but in my when I double click the JAR file,it displays that:-
Wndows cannot open this file: Use the web service to find the approprate program
Select aprogram from list
But non of the program from the list would open it correctly.But I saw in the program list of that other PC has a program called:-Java(TM) Platform SE binary ,but this program is not in the program list in my PC.
The file association that will make sure javaw.exe is called when a JAR file is executed is missing or broken. You can fix it yourself, but (re)installing the JRE / JDK as Sagar and Campbell suggested should solve the problem.
Actually, my guess is that Campbell is right and you don't even have the JRE installed on your PC. That would of course also explain why the file association is missing.
I know that if I reinstall JDK it may work.I think reinstalling the JDK is not the only solution.first I want to know which program(the file from bin derectory eg.java,javac,javaw,jar...) is responsible to executing JAR files.,but I have tried opening the JAR file with java,javaw,jar, but it does not working.If any any other option is left then suggest me,because if I give my JAR files to my friends and JRE is installed in their PC but they couldn't run my apps then it is not fair to tell them to install JRE again and again tiil it work.
In my PC if I execute The JAR file in command prompt it works:-
D:\>java -jar DigWatch.jar
Thanks Sagar,Campbell,Rob and Joanne !!! [ July 25, 2008: Message edited by: Ashok Pradhan ]
Joined: Oct 13, 2005
You have already said you couldn't find a java.exe on the 2nd PC, so you will have to install at least the JRE on that machine. Any computer would require a JRE to execute any Java files.