How do I build/deploy a Java program so that anyone can open it without an IDE or Command Line? -
this question has answer here:
- how make executable jar file? 2 answers
i built game in java, , want make can opened on other computer without using ide or command line or of like. basically, want computer games download internet , start playing.
i'm sorry if stupid question (or impossible question), english second language , don't know other way put it. basically, i've gotten pretty @ making video games, , i'm done game, don't know how make game can run without ide. namely, want little brother able double click on icon cause game start up.
now, approaching logically, i'd assume whatever computer game running on need have java downloaded (like jdk) or something, , i'm ok that. want able give doesn't speak or read english simple icon double click on , play game.
if impossible without industry grade developers, please let me know, since know of bigger games out use own version of language make game work. want know if possible me do, , if so, how. thank time!
you're looking "runnable jar". when create jar, use manifest file says main class (the 1 main
method). looks this:
so instance, suppose game implemented in package myniftygame
, class has main
gamemain
.
the manifest file (here i'm calling manifest.txt
) be:
main-class: myniftygame.gamemain
then build jar
, can use tools in ide or build script, or command line in parent directory of myniftygame
directory:
jar cfm myniftygame.jar manifest.txt myniftygame/*.class
(that slash backslash on windows.)
then, in modern os jre installed, double-clicking .jar
file or making target of shortcut, etc., make runtime open jar, see manifest, , call myniftygame.gamemain.main
method.
Comments
Post a Comment