1

I was having jdk_1.6 in my machine and I removed it and installed jdk_1.7. So after installing jdk_1.7 I am not able to run my jar file with double click. I could run the same file using command prompt.

After installing jdk_1.7 I run the program from eclipse using java 7 and I exported jar using the same.

I am using following command for running jar:

>>java -jar csv_generator_1.jar 

And this works fine and jar get executed.

But when I right click and open with javaw.exe in jad/bin folder or jdk/jre/bin/ folder it's not working.

I found same question here link1 and link2, but I am not understating what to do.

Can someone help me to resolve this?

Community
  • 1
  • 1
Madhusudan
  • 4,637
  • 12
  • 55
  • 86

2 Answers2

1

Go there and download newest verson of java RE and install it and it should work. But if it does not work you should get some kind of error message and try to google it. It is possible that your java(s) are broken.

Jussi Roos
  • 46
  • 6
  • I installed JRE and I opened jar using javaw.exe which resides in jre/bin/ folder. Thanks for response :) Please update your answer with more details. I didn't understand why jar didn't run using javaw.exe from jdk/jre/bin folder. – Madhusudan Jan 27 '16 at 16:26
0

If you install JDK, you may think it contains JRE but it's private. At least that was stated during installation process. Therefore, you had to install Public JRE.

JDK installer provides an option to do so but if you didn't check it, you might experience the problem you described.

JDK installation process

Genhis
  • 1,484
  • 3
  • 27
  • 29