Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

presenting my game

 
Tralli Lalli
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, my question is how to present my game created in java, I can run the game and all in textpad etc, but if I wish to send it to my friend so he can simply double click a single file and the game runs? I mean it�s no use sending him a .class file now is there?
 
Sean Magee
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Jar Files
 
Graham Renney
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am making the assumption that you are running on Windows.

There are a few java executable builders for windows: eg. EXE4J.

But realise that the strength of java is in its cross platform byte code. Creating an exe, locks your app onto a windows platform.

Also realise, that your friend will always need a JRE to run your java app - even if it is packaged as an .exe. It is very difficult to package the JVM with an app. The JVM alone is +-50MB big.
 
Yasith Vidanaarachchi
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Trali,
You can make a .exe file with the softwere J2Exe and you can
have any icon you like too here's the link.

http://www.geocities.com/j2exe/J2Exe.zip
And you can use it on a pc that don't have java.

Yasith

[ December 20, 2004: Message edited by: yasith vidanaarachchi ]
[ December 22, 2004: Message edited by: Yasith Vidanaarachchi ]
 
Lahiru Abeydeera
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create a ".Bat" file in windows or an ".sh" file on linux. (just create a notepad file and insert the code u use to run the program there and save. When it is double clicked the program will run.

Sorry I dont know how to do it on mac


lahiru
SCJP
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Lahiru Abeydeera:
Create a ".Bat" file in windows or an ".sh" file on linux. (just create a notepad file and insert the code u use to run the program there and save. When it is double clicked the program will run.

Sorry I dont know how to do it on mac


lahiru
SCJP

Recent versions of Mac OS are based on FreeBSD, so you can use the same .sh file as for Linux. I know this can be run from the command-line. It should also be "double-clickable", but my experience with Mac is limited and I can't say for sure.
 
Nick George
Ranch Hand
Posts: 815
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by yasith vidanaarachchi:
Hi Trali,
You can make a .exe file with the softwere J2Exe and you can
have any icon you like too here's the link.

http://www.geocities.com/j2exe/J2Exe.zip
And you can use it on a pc that don't have java.

Yasith



Yasith, can you explain what the "working directory"?
 
dave taubler
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can go to www.zerog.com to download their InstallAnywhere installer. It's buried pretty deep, so you need to do some searching, but they do offer a free version of their installer. It will make installers for every platform, but I pretty much find that I only need to create a Windows installer. You can specify that the installer include the Java runtime.

As for Mac OSX, you can be guaranteed that every copy ships with a Java runtime (and actually, the Java SDK for that matter.) You can't be guaranteed what version of Java the user has, but at this point, it's probably the rare OSX user that doesn't have Java 1.4+. So if you create an executable JAR, any OSX user will be able to double-click it to launch the app.

I don't think there's much of a philosophical problem with creating different installers or execution methods for different platforms, so long as the Java binary code is the same. But maybe that's just me...
 
Yasith Vidanaarachchi
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nick,
Sorry for being late, For the question I haven't used J2Exe on any OS other than Windows

Yasith Vidanaarachchi
---------------------
SCJP 1.4
[ January 28, 2005: Message edited by: Yasith Vidanaarachchi ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic