Sign in to follow this  
LoopyWolf

[java] How to deploy a Java OpenGL application

Recommended Posts

I'm been working on a java game using openGL for the past few months and I'm nearing the end of the road, and I'm at a point where I'd like to be able to show friends, co-workers, etc What I'm seeking is a method to deliver it to them, in such a way that even those who don't have Java will still be able to see it, ie., it will install a JRE for them if they need one (they are not programmers.) I've done some research, but so far I've come up trumps. - I tried using Eclipse to generate a Runnable JAR file, but when I tried to run it, it threw a bunch of errors saying it couldn't find the resource files - I tried Eclipse with just a jar, but when I run that I got a NoClassDefFoundError on javax/media/opengl/AbstractGraphicsDevice and Could not find the main class: CubeGL. Program will exit. - I tried jSmooth, but I couldn't figure out how to work it and couldn't find any docs - I tried Advanced Installer 7.2 but when I install it, even on the DEV machine, it says it cannot find the main class CubeGL Two other things I'll be looking into will be jnlp, and the possibility of using that free installer.. I've seen some webpages that say it can be set up to install a JVM for people too. Details: I use Eclipse for my development, and I'm on windows. I am using JOGL for openGL development and I believe it requires certain DLLs to run. If screenshots will inspire folks any to help, here: http://wolfwares.spaces.live.com/blog/cns!D76C8C3E077E4589!319.entry and previous I was just wondering if anybody had a simpler solution for bundling and delivering Java games and apps than this that they'd like to share? Thanks, -LL2

Share this post


Link to post
Share on other sites
I've been thinking about this exact thing for quite a while. This, in my opinion, is why Java is not as popular as I think it should be. There are just so many problems trying to deploy the application, and not many solutions if the client machine is not properly configured.

Having said that, I have been wondering if there is a way to deploy you application with everything it needs: JRE, Libraries, everything. I have not tried it, but this is what I'm planning the next time I release my current project.

I know this doesn't really help, but it might be something to try. I could make for a huge download, but then all they would have to do is run a *.bat or *.sh file to start the application, and they could have any other type of Java on their machine.

Has anyone ever tried this?

Share this post


Link to post
Share on other sites
Quote:
Original post by LoopyWolf
I was just wondering if anybody had a simpler solution for bundling and delivering Java games and apps than this that they'd like to share?

I'm on NetBeans, and whenever I have multiple libraries that I want to bundle together, I just toss an extra command into the build.xml script. Here's one example for including the swing-layout library:
<target name="-post-jar">
<jar update="true" destfile="${dist.jar}">
<zipfileset src="${libs.swing-layout.classpath}"/>
</jar>
</target>
NetBeans does the rest, and when executing the jar, everything's right where it should be. The jar ends up getting a bit bloated because of all the extra files its bringing in, but it works.

In NetBeans, you can also add image and sound files to your "Source Packages" directory. In one of my programs, I have a simple "image" package with all my images tossed in there. When building the project, NetBeans puts everything into the jar just fine, and I've had no issues accessing those files.

[Edited by - Omega147 on September 14, 2009 5:32:10 PM]

Share this post


Link to post
Share on other sites
JSmooth works just fine for apps with native libraries (like Jogl & LWJGL). IMHO it's the best way to distribute apps for windows since it's nice and familiar and Just Works if you package it right.

If you can't get jsmooth to work then I suggest either reading the documentation (it's detailed enough, IMHO) or posting your exact problem.

Share this post


Link to post
Share on other sites
Quote:
Original post by Omega147
Quote:
Original post by LoopyWolf
Darn makes me wish I had netbeans..

NetBeans is free and available for Windows, Mac, Solaris and Linux. Give it a try. :)


But isn't NetBeans a sort of Slick/GUI communications package? I didn't build my project with NetBeans and it's not that sort of program.. It's just OpenGL and no communications.. still worth a look?

Share this post


Link to post
Share on other sites
Quote:
Original post by LoopyWolf
But isn't NetBeans a sort of Slick/GUI communications package? I didn't build my project with NetBeans and it's not that sort of program.. It's just OpenGL and no communications.. still worth a look?

I think I may have misunderstood what your goal is with my suggestion of using NetBeans. JSmooth seems to be along the lines of what you're looking for.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this