hi, how i can create executable file in java.
This has been asked and answered many times before on SO;
e.g. How can I convert my Java program to an .exe file?.
i want to set java home by creating my executable file.
That simply makes no sense. You cannot set an environment variable (e.g. $JAVA_HOME) or Java property (java.home) by creating an executable file.
so please give some example how i can set java home by executable file
That makes slightly more sense, but the question is where do you want to set it. If you want to set $JAVA_HOME
/ %JAVA_HOME%
for a shell, you have to do this by executing a shell builtin-command, or by launching a new shell. You could set the Java java.home
property in a currently executing Java program, but there is no point ... it will most likely just break things.
Based on your past questions, I'm going to make a wild guess and that you are trying to set the $JAVA_HOME
/ %JAVA_HOME%
for a Tomcat instance. If that is the case, then: