Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (549)
Games in Android Showcase (137)
games submitted by our members
Games in WIP (594)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  Java games on PC's with no Java?  (Read 4806 times)
0 Members and 1 Guest are viewing this topic.
Offline mike_bike_kite

Senior Devvie


Medals: 1
Projects: 2



« Posted 2013-08-20 08:43:22 »

I have a java web start game which people with Java happily play but many folks don't have Java and don't want to install Java. I tried zipping the jar and including java.exe in the zip, then I had a small windows bat file that calls the java.exe to run the jar. It worked fine on my machine but then I already have Java. It didn't work on PC's with no Java or an out of date Java.

Bat file is:
Quote
java.exe -jar -Dsun.java2d.noddraw=true AlienSwarm.jar FULLSCREEN 2>tmp.log

exit;

Any ideas?

Arcade swarm
Board Chess - Checkers - Othello
Offline namrog84

JGO Ninja


Medals: 46
Projects: 4


Keep programming!


« Reply #1 - Posted 2013-08-20 08:45:54 »

Have you tried using something like JSmooth or IzPack? Or an equivalent pseudo automated packager?

Something that can bundle a full java JRE with your game, so that you don't depend upon an existing jre install?

"Experience is what you get when you did not get what you wanted"
Offline princec

« JGO Spiffy Duke »


Medals: 452
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #2 - Posted 2013-08-20 09:54:34 »

Hi Mike, take a look at our games for a way to do it. We use a custom C++ launcher on Windows but OSX and Linux just use shellscript. The C++ launcher is pretty trivial to make.

Cas Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline mike_bike_kite

Senior Devvie


Medals: 1
Projects: 2



« Reply #3 - Posted 2013-08-20 10:33:12 »

Thanks for the very fast replies guys!

Jsmooth - will this just run the java.exe program in my zip file? I want to avoid the program even mentioning to the user that it's running Java. The people running my program are putting it into arcade machines and obviously they just want it to run rather than show popups saying that your Java needs updating. Is it easy to use?

IzPack - same questions as above really.

C++ - I program in many languages but unfortunately C++ isn't one of them. Is there an example somewhere of how to do this? Was this how you put your Revenge of the Titans onto steam? Did you produce a blog/txt/post of how you did this and whether it was worth the effort. Obviously my little program isn't as flash as yours but it can be quite addictive and people seem to enjoy playing it so it would be nice to make a few pennies from the effort.

Arcade swarm
Board Chess - Checkers - Othello
Offline gouessej

« In padded room »

« Reply #4 - Posted 2013-08-20 11:19:01 »

I remind you that you can use some options of Java Web Start to hide some elements so that they never see it requires Java. You can then provide the JRE and use Java Web Start, maybe look at the "-import" option. IzPack has no automatic update but if you want to use it, you can look at some free softwares using it, for example Art Of Illusion.
Offline princec

« JGO Spiffy Duke »


Medals: 452
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #5 - Posted 2013-08-20 12:55:18 »

I'm afraid I've not blogged about it or anything much but I'll put some C++ code in the pastebin for you to peer at: http://pastebin.java-gaming.org/6f78e8e8d6a
It can be a bit simpler than that Wink

Cas Smiley

Offline Cero
« Reply #6 - Posted 2013-08-20 22:31:53 »

I use batch to exe. Just create a batch file, package your own private jre and there you go.

Online BurntPizza

« JGO Bitwise Duke »


Medals: 321
Exp: 6 years



« Reply #7 - Posted 2013-08-20 22:39:41 »

C++ - I program in many languages but unfortunately C++ isn't one of them. Is there an example somewhere of how to do this?

If you don't want to mess with C++ for an installer I highly recommend NSIS.

I combine that with Cero's technique and it works quite well.
Offline Cero
« Reply #8 - Posted 2013-08-20 22:56:03 »

Yeah, I use NSIS as well

Offline Grunnt

JGO Kernel


Medals: 95
Projects: 8
Exp: 5 years


Complex != complicated


« Reply #9 - Posted 2013-08-21 05:45:59 »

You can also use Launch4j to wrap a runnable jar file into a Windows executable. Launch4j has support for embedding a JRE.

Only including java.exe will not work, by the way, since the java runtime environment requires many other files to function. Take a look at the JRE installation on your computer (e.g. c:\program files\java\jre7 or something), it will be over 100MB in size. You van reduce the size of the Oracle JRE (which is by the way perfectly legal to redistribute along with your app) by leaving out some files and doing other tricks. There's a good answer on StackOverflow on how to do this. Still, expect a somewhat sizeable installation file, although that is hardly a problem these days.

Personally I use Excelsior JET, that integrates its own virtual machine into the compiled executable, but that is somewhat expensive for indie developers (I got it in a charity deal). I like this one because it lets me reduce the size of the resulting executable further than most other approaches (say to under 10MB including runtime), and its pretty easy to use and maintain.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

« JGO Spiffy Duke »


Medals: 452
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #10 - Posted 2013-08-21 07:44:28 »

Jet's great.

Batch to EXE is interesting, never seen that before though I suppose it's obvious such a thing must have existed.

I tried Molebox as well but it falls foul of so many virus checkers I've had to abandon it once more.

Cas Smiley

Offline namrog84

JGO Ninja


Medals: 46
Projects: 4


Keep programming!


« Reply #11 - Posted 2013-08-21 08:48:23 »

Grunnt, at first I was like damn. I wish I could use Excelsior JET, that seems super cool, but its soo expensive! You are lucky!

Then I went hmmmmmmm  Huh

Searched my email and Shocked  realized some 8 months ago, I got it for $10 during that same charity deal  Grin


"Experience is what you get when you did not get what you wanted"
Offline mike_bike_kite

Senior Devvie


Medals: 1
Projects: 2



« Reply #12 - Posted 2013-08-21 10:46:46 »

Quite a lot of choices and I find it difficult picking an option
<a href="http://www.youtube.com/v/3PgbNQU3cYo?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/3PgbNQU3cYo?version=3&amp;hl=en_US&amp;start=</a>

Do any of the above satisfy the following?
  • My budget is currently around $0
  • My users often don't have Java and/or don't want Java
  • A precious few seem to have old versions of Java
  • None want to see popups appearing telling them to download the latest Java or asking whether they really want to run the program
  • Many actively don't want to instal Java because of perceived security issues etc
  • I guess they'd prefer an exe if they had the choice - I know this rules out Linux but I guess they can run the standard jar.

PS can anyone PM me on how to get the youtube video appearing? (I tried help and half a dozen random formats)

Arcade swarm
Board Chess - Checkers - Othello
Online SHC

2: log() expects parameter 1 to be double, string given
File: /home/jgo/public_html/addon_appreciation.php
Line: 191