-2

Possible Duplicate:
how can I create executable file for the program written on Java?

hi, how i can create executable file in java. i want to set java home by creating my executable file. so please give some example how i can set java home by executable file

Community
  • 1
  • 1
Chitresh
  • 3,022
  • 12
  • 35
  • 40
  • before asking an SO question, you should always do a search to see if someone has asked it already. – Stephen C Mar 19 '11 at 08:19
  • The question is unclear. If you compile a class with a main mehtod, it is executable. If your system isn't configured the right way, you have to fix that. You're talking about JAVA_HOME? Be precise! You want to create a batch- or script-file to start your program with a specific JAVA_HOME? Well, first, choose an operating system. – user unknown Mar 19 '11 at 08:44

2 Answers2

2

Try following options:

JSmooth

http://sourceforge.net/projects/launch4j/

Ans Check this thread for more options

Community
  • 1
  • 1
0

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.homeproperty 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:

Community
  • 1
  • 1
Stephen C
  • 698,415
  • 94
  • 811
  • 1,216