There is a /s option in JRE installer (see here), so basically you can.
However, you will have to somehow download JRE to client's workstation. I suggest using wget for this.
However, you can also use java-to-exe wrappers - JSmooth for example can automagically download JRE for you if it is not installed.
Answer from npe on Stack OverflowThere is a /s option in JRE installer (see here), so basically you can.
However, you will have to somehow download JRE to client's workstation. I suggest using wget for this.
However, you can also use java-to-exe wrappers - JSmooth for example can automagically download JRE for you if it is not installed.
You can make it on a bat file and ship a folder with an embeddable JVM, nevertheless I found using NSIS very effective for shipping swing APPS.
NSIS
I'm not sure but I think you can also build the kind of installer you want.
Videos
Steps to fix this error in windows 10/8/7
1.Check your javac path on Windows using Windows Explorer C:\Program Files\Java\jdk1.7.0_02\bin and copy the address.
2.Go to Control Panel. Environment Variables and Insert the address at the beginning of var. Path followed by semicolon. i.e C:\Program Files\Java\jdk1.7.0_02\bin; . Do not delete the path existent, just click in and go to the left end and paste the line above. Do not try anything else, because you just need to link your code to "javac.exe" and you just need to locate it.
3.Close your command prompt and reopen it,and write the code for compile and execution.

You need to add the location of your JDK to your PATH variable, if you wish to call javac.exe without the path.
set PATH=%PATH%;C:\path\to\your\JDK\bin\dir
Then...
javac.exe MyFirstProgram.java
OR, you can simply call it via the full path to javac.exe from your JDK installation e.g.
C:\path\to\your\JDK\bin\javac.exe MyFirstProgram.java