Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (590)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Windows distrib error  (Read 1405 times)
0 Members and 1 Guest are viewing this topic.
Offline zlandorf

Junior Devvie


Medals: 1
Projects: 1



« Posted 2011-09-01 18:26:42 »

Hello all,

I was wondering, if you need to distribute a .jar to non programmers. How would you make sure the jar runs ? ie that the JAVA_PATH is set, and that the jar finds the java.exe.

I'm asking this, because my jar won't launch under windows without me specifying the java.exe location (haven't set the JAVA_PATH, and since the end user mustn't do any configuration to play a game ...)

Also another question. I'm using lwjgl, and my .jar needs a link to the native. I can't dynamically set java.library.path, so I'm going through a script that just calls the java -jar command and setting the java.library.path at the same time. Do you generally go through a script / exe or do you create another jar that does the call ? or is they a way to load the native dynamically ?

Thanks in advance,
Zlandorf
Offline ra4king

JGO Kernel


Medals: 355
Projects: 3
Exp: 5 years


I'm the King!


« Reply #1 - Posted 2011-09-02 03:29:51 »

The JAVA_PATH should have been automatically set when Java was installed.

You can use either this Fat Jar creator which puts everything in 1 jar and it automatically launches your application, or you can look at this app, which creates a native executable for Windows, Mac, and Linux.

Offline gouessej
« Reply #2 - Posted 2011-09-02 08:42:07 »

Hi

You can use applets or Java Web Start, it would be better. If you choose Web Start, avoid FatJar & co. because it creates big JARs and when Web Start downloads the JARs, the progress bar is updated only when a full JAR has just been downloaded, it means that if the download is quite long with a single JAR, the progress bar won't be updated and the final user will believe that your game crashes and does not work. I have this problem with my game, some JARs takes so long to be downloaded, some people believe that something is wrong and stops the install process Sad

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online Cero
« Reply #3 - Posted 2011-09-02 10:40:34 »

I ship jvm with it and exe files instead of jars
not taking any chances
and surely I don't assume everyone has java installed

obviously only if you deploy "real things"

Offline zlandorf

Junior Devvie


Medals: 1
Projects: 1



« Reply #4 - Posted 2011-09-02 11:32:29 »

@raAking:
Its weird, my JAVA_PATH wasn’t set on windows even though I have eclipse + java installed.
I already got a one runnable jar (with several jars inside). I was using the batch/sh files actually to be able to pass an argument for the one jar file (i generate two, one for a server and one for a client, and for the moment the client can input the host address as an argument, but no worries, its temporary, I'll add a textfield or something in-game once I have time) and also for giving the java.library.path thing aswell
edit: I mistook  the fat Jar with something else (the ant script that puts jars in jars), it seems quite nice as well actually. Its exactly what I was looking for, thanks very much Smiley

Thanks for linking that launch4j, seems nice. I'll look into that for sure.

@gouessej:
I was planning for a webstart too. Maybe not an applet though. A lot of people on the website seem to dislike webstart and like having a downloadable version. I got a webstart working for a lwjgl test application, so I think I'll manage for this one :p
I didn't know the progress bar depended on the number of jars downloaded, thanks for the info.

@Cero:
I'm in a bit of that mindstate as well. I'm guessing the exe instead of plain jar is because you are scared that a random user won't click on a .jar because he won't know what it its ?
And do you use launch4j for your shipping too ?

Thanks everyone for helping me out Smiley
Zlandorf
Online Cero
« Reply #5 - Posted 2011-09-02 13:16:49 »

@Cero:
I'm in a bit of that mindstate as well. I'm guessing the exe instead of plain jar is because you are scared that a random user won't click on a .jar because he won't know what it its ?
And do you use launch4j for your shipping too ?

also, like I said, I dont assume the user has java, and sometimes jars dont even work because, stuff like winrar takes the extension and stuff.
I dont use any of those java tools like launch4j, splice and whatnot
I just a batch to exe converter (compiler)
I just make a batch that works, open the program, which is free, compile a exe out of it, give it an icon, and there you go
you can set whether or not to have a visible console.
I just find all these tools kinda weird and difficult to handle.

since I ship the jvm with it, I just do something like " "jvm/bin/java" arguments -jar jarfile " and so on, and its a relative path to the jvm shipped, so it works everytime.

Offline zlandorf

Junior Devvie


Medals: 1
Projects: 1



« Reply #6 - Posted 2011-09-02 13:48:19 »

it does seem simple enough the way you present it.

thanks for the info:)
Online Cero
« Reply #7 - Posted 2011-09-02 13:55:47 »

it does seem simple enough the way you present it.

thanks for the info:)

just to note: I'm pretty sure, no one else here does it like that, but I like to keep things simple

Offline Mads

JGO Ninja


Medals: 26
Projects: 3
Exp: 6 years


One for all!


« Reply #8 - Posted 2011-09-03 22:55:35 »

I ship jvm with it and exe files instead of jars
not taking any chances
and surely I don't assume everyone has java installed

obviously only if you deploy "real things"

I don't see the reason to deploy windows executables, when developing applications in java. Thats defeating the point of the WORA.
Why not distribute .jars and put a notice with it, about the need for Java to be installed. It seems to work for pretty large audiences - see Minecraft, Runescape or FunOrb.

Online Cero
« Reply #9 - Posted 2011-09-03 23:08:29 »

first: there are many negative preconception about java in mainstream's mind, java is slow, stuff like minecraft may help to eventually reduce those, but we are not there yet
not completely hide, just from the eyes of the user: you have an installer, an exe, a couple of folders; thats it.
its also part of the philosophy "making technology invisible"
which brings me to my second point:
the user should never have to deal with any tech shit. simple as that. every little thing the user has to install prior to being able to play, is a turnoff
a windows user just wants an exe and shortcut, double click it, and boom, is just works.

So I rather have 3 versions, each specifically done for each OS (with few code changes thanks to java), which will simply work on that platform, than having one for all, that you can somehow get to work on all
users shouldn't have to deal with any of that.

Also 95% are windows users anyway. We are talking about GAMES here... not a whole lot of PC market beside windows.

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

Junior Devvie


Medals: 1
Projects: 1



« Reply #10 - Posted 2011-09-03 23:52:34 »

yeah, I prefer having different versions that work everywhere even if I have to go through a little trouble than the one that can cause problems to the users.

Cause the average user (me included) that comes upon a problem when trying to launch a free game downloaded on the internet will not go any further.

@Mads:
btw, minecraft does come with an exe on windows

Is runescape only applet ?
Offline ra4king

JGO Kernel


Medals: 355
Projects: 3
Exp: 5 years


I'm the King!


« Reply #11 - Posted 2011-09-04 04:18:08 »

Yeah Runescape is browser only.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

trollwarrior1 (27 views)
2014-11-22 12:13:56

xFryIx (69 views)
2014-11-13 12:34:49

digdugdiggy (48 views)
2014-11-12 21:11:50

digdugdiggy (42 views)
2014-11-12 21:10:15

digdugdiggy (36 views)
2014-11-12 21:09:33

kovacsa (60 views)
2014-11-07 19:57:14

TehJavaDev (64 views)
2014-11-03 22:04:50

BurntPizza (62 views)
2014-11-03 18:54:52

moogie (77 views)
2014-11-03 06:22:04

CopyableCougar4 (77 views)
2014-11-01 23:36:41
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!