Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3509 Members - Latest Member: lioneltenel

27. May 2012, 02:01:21 am
Xith3D CommunityProjectsYour Projects (Moderator: 'n ddrylliog)Help!
Pages: [1]
Print
Author Topic: Help!  (Read 2510 times)
kukanani
Fierce Warrior
****
Offline Offline

Posts: 504


My game is coming along fairly smoothly...


View Profile WWW
« on: 10. November 2007, 05:26:43 pm »

Why would it be that every time I create ANY .jar file and try to run it, it tells me "could not find the main class.  Program will exit" errors??!?  I have already un- and re-installed Java - twice.  And, yes, the JAR definetly has a working manifest...otherwise I would get "failed to load MAIN-CLASS attribute from manifest" errors, which I don't.  Help!
Logged

xith.setCoolnessLevel(10);
jMe.setCoolnessLevel(0);
xith.rock();
kukanani
Fierce Warrior
****
Offline Offline

Posts: 504


My game is coming along fairly smoothly...


View Profile WWW
« Reply #1 on: 10. November 2007, 06:22:22 pm »

Well, decided to scrap the JAR idea and go for JWS again.  Now, my program gets no errors, but the JOGL window opens, the title bar changes to what I told it to change to, and then the program just hangs, using 94,000 K memory (according to the Task Manager).  It also has that strange behavior of looking like the window below it...it's not black.

FIXED!

Yay!  A working JWS!
« Last Edit: 10. November 2007, 06:54:24 pm by kukanani » Logged

xith.setCoolnessLevel(10);
jMe.setCoolnessLevel(0);
xith.rock();
hawkwind
Getting respectable
***
Offline Offline

Posts: 363



View Profile Email
« Reply #2 on: 10. November 2007, 08:49:23 pm »

details...details  an example perhaps??
Logged
kukanani
Fierce Warrior
****
Offline Offline

Posts: 504


My game is coming along fairly smoothly...


View Profile WWW
« Reply #3 on: 10. November 2007, 08:56:25 pm »

Yes yes, of course.  Actually, this was the only thing holding up my real website development.  I will give the entire rundown soon....

Kukanani
Logged

xith.setCoolnessLevel(10);
jMe.setCoolnessLevel(0);
xith.rock();
kukanani
Fierce Warrior
****
Offline Offline

Posts: 504


My game is coming along fairly smoothly...


View Profile WWW
« Reply #4 on: 10. November 2007, 09:31:21 pm »

OK. This will be a long post.  Here we go...

1.  Firstly.

I can't seem to get the JWS file to work directly from the web.  When I try this, my application cannot find any resources (images, models, etc.).  So here's how it must go:  The JWS file, the "Models" resource folder, and the other "Images", "Text", and "Audio" resource folders must all be on the local machine of the person trying to run the game.  This is the single problem with my setup.  Sorry if I dashed your hopes...oh, also, this is only for Windows, but anyone with good knowledge of Java and half a brain could change that... Wink

2.  Preparation

Set up your application in Eclipse/NetBeans to be whatever you will want the final version to be.  This is crucial, as it may take some time to re-build.  Then, make a security key.  Use the keytool for that.  This will be used to secure your JAR's.  Copy the entire "bin/org" folder of the xith3d project into your Java's /bin/ folder.  Copy the base directory of your application's binary code, such as the whole /com/ directory of /com/awesomegame/..., into the Java /bin/ also.  Copy the following JAR files - jogl.jar, hial.jar, media.jar, hud-themes.jar, openmali.jar, gluegen-rt.jar - from the Xith /third-party/ directory, and put them in the Java /bin/ too.  The last things to go in the /bin/ are the three jogl .DLL's for your OS, the gluegen .DLL, and any others that go with the JAR's that I mentioned above. 

3.  Batch Files

If you ever plan on making your application more than once, this is a must-have.  It saves your poor fingers  Smiley.  I used a batch file to put the DLL's in JAR's and sign them, and another to sign all the standalone JAR's.  Get them at the end of the post.  Use your security key's passwords.  Also, make a batch file to pack your application's main JAR, and then use the batch file (also at the end of the post) to pack and sign Xith3D's JAR.

Now that everything is packed up in JAR's and signed, let's move on (to the next post)...
Logged

xith.setCoolnessLevel(10);
jMe.setCoolnessLevel(0);
xith.rock();
kukanani
Fierce Warrior
****
Offline Offline

Posts: 504


My game is coming along fairly smoothly...


View Profile WWW
« Reply #5 on: 10. November 2007, 09:43:19 pm »

4. Java Web Start

Here is the interesting part of the JWS file that I used.  You can find out more about JWS by Google-ing "The Java Tutorials" or alternately, by looking at JavaCoolDude's examples at http://users.xith.org/JavaCoolDude/JWS/Xith3D/.

[The <xml>, <jnlp>, and <information> tags would go here...]
  <security>
    <all-permissions/>
  </security>

  <resources>
    <jar href="MyApp.jar" main="true"/>
    <jar href="jogl.jar"/>
    <jar href="hial.jar"/>
    <jar href="Xith3D.jar"/>
    <jar href="jagatoo.jar"/>
    <jar href="openmali.jar"/>
    <jar href="gluegen-rt.jar"/>
    <jar href="hud-themes.jar"/>
    <jar href="media.jar"/>
  </resources>

  <resources os="Windows">
    <j2se href="http://java.sun.com/products/autodl/j2se" version="1.6+"/>

    <property name="jinput.plugins" value="net.java.games.input.DirectInputEnvironmentPlugin" />

    <nativelib href="jogl-awt-windows-native.jar"/>
    <nativelib href="jogl-cg-windows-native.jar"/>
    <nativelib href="jogl-windows-native.jar"/>
  </resources>

  <application-desc></application-desc>
</jnlp>


4. Real Deployment

I used Inno Setup, but you don't have to.  Just make these things download-able: the JWS file, and all non-Java resources (text, models, images, sound, etc.).  Put ALL JAR files on the web, in the codebase that you set your JWS file to use.  You don't need to add the old .DLL's, just their JAR's. Then the user downloads your JWS and all the resources, double-clicks the JWS file on their computer, and the application opens magically.  OK, so maybe not magically, it took quite a bit of work...

Hope you enjoyed that short novel.  Here is the Wiki version - http://xith.org/wiki/index.php/JWS_deployment.
Logged

xith.setCoolnessLevel(10);
jMe.setCoolnessLevel(0);
xith.rock();
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #6 on: 12. November 2007, 01:11:15 am »

Thanks a lot for this contribution.

Marvin
Logged
kukanani
Fierce Warrior
****
Offline Offline

Posts: 504


My game is coming along fairly smoothly...


View Profile WWW
« Reply #7 on: 12. November 2007, 01:59:40 am »

Sure.  Smiley  You may want to move this to "Your Projects", though...
Logged

xith.setCoolnessLevel(10);
jMe.setCoolnessLevel(0);
xith.rock();
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic