i am trying to run a jar file i created from net beans when i built my new project.it is giving me error cant launch application i tried everything.I am using window7,i opened the command prompt and put
assoc jarfile
ftype jarfile="C:\Program Files\Java\jdk1.6.0_01\bin" "%1" %*
and tryied to run it again but useless,wish any body can help me
regards

  1. make sure you have JRE installed
    should be located at C:\Program Files\Java\jre6(or jre7)
  2. open cmd prompt and navigate to the directory where the file is located
  3. then type the command java -jar filename.jar (use your jar fileneme) or just double click the jar file

apreciate ur response
ive installed jre7 and yes i tried it in command prompt as u written it worked fine but when i m double clicking it is not working!!

in that case, make sure you have your environmental settings and your classpath in your os set correctly.

ive set my class path as
PATH as variable and .;c:\program files\java\jdk1.6.0_01\bin as value
u mean to add the same but instead of jdk to put jre7's path

sorry i mean i set my environment variables as
PATH as variable and .;c:\program files\java\jdk1.6.0_01\bin as value
u mean to add the same but instead of jdk to put jre7's path

PATH as variable and .;c:\program files\java\jdk1.6.0_01\bin as value
u mean to add the same but instead of jdk to put jre7's path

i have created Runnable Jar file,when i clicked jar file,it says error

you have a talking jar file? now that's curious.
or do you mean that when you try running it by double clicking, it shows an error message?
if so:
1. read the above answers
2. try the possible sollutions provided there
3. if that doesn't work, consider starting a new thread, in which you specify what error message was shown and what you've tried.

(environment settings ok ... manifest file correct ... stuff like that)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.