Skip to main content
gamedev.net
🔒 Locked

[java] Distribution of Java Games

Started by Neurotic 5 replies 600+ views
Original Post
Neurotic
Neurotic
Heya all, I''m currently working on a networked boardgame in Java. Eventually we are looking at packaging this on a cdrom, along with some pretty tutorials and the like. In terms of distribution, I was considering placing the jre on the CDROM, and simply running a batch file that would call the jre to run on my .jar file. This means that I don''t have to worry if the user has a older version of the jre, or even doesn''t have it at all, and therefore the game runs no matter what. However, its often nice for the user to find a .exe rather than a .bat file lying around. Looking into this, I found three different things: 1) Under the JNI section, there were some paragraphs about wrapping the JVM with the program into a .exe with C/C++ and running the JVM invoker from there. 2) I was wandering my way thru the Microsoft SDK for Java 4.0, and saw a program called jexegen. Never the less, I couldn''t seem to get it to work with my Sun compiled code. (In all honesty I didn''t expect it to, but I was curious to see what would happen), nor would it compile the .java files that I had writen under standard java. 3) Java Native Compilers don''t do AWT/Swing, so stuff them. Now I am just curious if anyone has had the same issues? Has anyone had any experience with the above methods/ideas for distribution? Any major issues/how easy/hard is it to get the program to an .exe? Should I even bother? (Cross compatability is not a huge issue here) Cheers, Mark ---- www.emanatemultimedia.com ----
<< ...and here is one we developed earlier... >>
felonius
felonius
Hi Mark,

> 2) I was wandering my way thru the Microsoft SDK for Java 4.0,
> and saw a program called jexegen. Never the less, I couldn''t
> seem to get it to work with my Sun compiled code. (In all
> honesty I didn''t expect it to, but I was curious to see what >would happen), nor would it compile the .java files that I had
> writen under standard java.

class files compiled with J++ (and required by exegen) are not Java standard complying. The Microsoft java compiler isn''t standard complying either.
In fact J++ is the worst piece of crap in existance if you want to write proper Java programs. Avoid.

> 3) Java Native Compilers don''t do AWT/Swing, so stuff them.

Wrong!

This depends on the Java Native Compiler. WebGain/Symantec Visual Cafe works very well with AWT/Swing apps for native compilation. If I have so myself several times.
In fact, Swing apps is some of the programs that benefit most from being native compiled. (A speed up of 3-5 times suddenly making Swing apps useable. Why didn''t they do this with Forte? :-) )

In fact that compiler supports the compilation of class files so any 3rd party library can be compiled to native code as well even if you don''t have access to the source code. All the standard libraries (including Swing) comes precompiled in DLLs with the compiler so you just have to install them on the target machine to use them.

Jacob Marner
Jacob Marner, M.Sc.Console Programmer, Deadline Games
Neurotic
Neurotic
Whooops!

Was it you who wrote a similar thing in another Java post here.. one i just HAPPENED to read as soon as I posted this...

Okay then.. the only Java Native compilers I saw in the short perid I was looking were.. >thinks< gcc one... and something else.. TowerJ I think... I went looking for the Symantec one.. and obviously couldn''t find it on their website, and they claimed not to support Swing/AWT.

But good point about the AWT/Swing dlls coming with the compiler.. not something I had thought of.

As per visual J++/Microsoft SDK.. I figured I''d have a look Anything is possible

But hell.. I wouldn''t WRITE java code under the compiler.. are you CRAZY?

Cheers for your thoughts,

Mark


----
www.emanatemultimedia.com
----
<< ...and here is one we developed earlier... >>
Ranok
Ranok
I don''t know what your using to write your java code but I thought I would point out that Metrowerks'' Code Warrior has the option to output java code into an .exe

It is also really simple to do this, all that you need to do is change one linking option for the compiler an you will get and .exe instead of the .jar that you normally get.
---Ranok---
c_wraith
c_wraith
Actually, this is a REALLY simple problem.... You can write a VERY short C program that serves the exact same job a batch file would. It may waste 50k or so, but it serves the jobs you want. This should work in just about any C compiler.

    

#include <stdlib.h>

int main(int argc, char **argv)
{
system("put your command line here");
return 0;
}



That''s all you need to make an .exe that serves the purpose of a single line batch file.
felonius
felonius

>Was it you who wrote a similar thing in another Java post
> here.. one i just HAPPENED to read as soon as I posted
> this...

Probably.

> Okay then.. the only Java Native compilers I saw in the short
> perid I was looking were.. >thinks< gcc one... and something
> else.. TowerJ I think...

Yes, these two does not support AWT/Swing. the gcc front-end is not done and TowerJ is only intended for servers.

> I went looking for the Symantec one.. and obviously couldn''t
> find it on their website, and they claimed not to support
> Swing/AWT.

Look at the Webgain website. You can download a free trial.

See the fact sheet here
http://www.webgain.com/Products/Expert_Edition/fact_sheet.html

Download trial (324 MB!!!) or request CD-ROM here.
http://www.webgain.com/Products/Studio/WebGain_Studio_trialware.htm

Webgain Studio includes Visual Cafe as part of its suite so you have to use that trial version as not sepearate trial version is available for Visual Cafe. Please be wawre that bugs have been corrected in the commercial version compared to the trial version.

> But hell.. I wouldn''t WRITE java code under the compiler.. are
> you CRAZY?

??? I don''t understand what you mean. Please explain.

Jacob Marner
Jacob Marner, M.Sc.Console Programmer, Deadline Games
Neurotic
Neurotic
>laughs<

when I said that, I was refering to the Mirosoft Java/J++ Compiler...

I wasn''t saying "Oh gee.. I wouldn''t write Java code not compiled" or somesuch rediculous thing

Mark

----
www.emanatemultimedia.com
----
<< ...and here is one we developed earlier... >>

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.