-2

i just copies the bin folder of java jre to the folder containing the program and used temp path variables to the copied bin folder.It perfectly worked in pc where jre or jdk is not installed but on my other pc where jdk is installed, it detects the path but error comes"error:java.dll not found" this is my problem.

i am using set PATH=\java\bin%path%

What i am trying to achieve is that: there will be no need to install jre to and define path in new computers to run the jar file

  • Well I would guess that you would have to narrate the complete story of playing with the bundled jdk/jre and the way you are setting the path. What you actually mean by temporary path variables and what jdk are we talking about in the different machines? Also on a side note, what are you trying to attempt anyway? – Naman Oct 28 '17 at 08:43
  • Okay, still unclear what differences does the two machines persist and what are their respective configuration. You shall share PATH variable configuration of both the machine(which is what I would suspect at first) and then also the JDK version(s) configured on each machine. Please note to update all of this in the question to make it meaningful and not in comments. – Naman Oct 28 '17 at 08:52
  • Do take a look at [Error when checking Java version: could not find java.dll](https://stackoverflow.com/questions/9313353/error-when-checking-java-version-could-not-find-java-dll?noredirect=1&lq=1) and [“Could not find Java SE Runtime Environment.” after installing Java](https://stackoverflow.com/questions/19329047/could-not-find-java-se-runtime-environment-after-installing-java?noredirect=1&lq=1) – Naman Oct 28 '17 at 09:03

1 Answers1

0

You need the lib folder also. Some computers require it and some don't.

Don't just copy the bin folder. Copy the lib folder also with it. And use set path=java\bin\ . this will work in all PC.