Results 1 to 2 of 2
  1. #1
    gib65 is offline Member
    Join Date
    Jun 2010
    Posts
    86
    Rep Power
    0

    Default java web start not working

    I know this is the forum for java applets and not JWS, but applets are the closest thing to JWS I could find on these forums. Please accept my apologies and move this to where it belongs if this is inappropriate.

    Also, this is a cross-post from here. I'm cross-posting because I need an answer to this ASAP and I don't seem to be getting one fast enough at javaprogrammingforums.com (no offense to them :D).

    Anyway, here's the OP from there:

    I have a java application uploaded as a JWS program: Maze Mania

    Under the MazeMania folder, I have:

    MazeMania.html
    MazeMania.jar
    MazeMania.jnlp

    I also have a "classes" folder in here with all my un-jarred class files in the appropriate packages (folders), but I don't think they're being used.

    My html file looks like this:

    Java Code:
    <html>
    
    <head>
    <title>Maze Mania</title>
    </head>
    
    <body>
    <script src="http://www.java.com/js/deployJava.js"></script>
        <script>
            // using JavaScript to get location of JNLP file relative to HTML page
            var dir = location.href.substring(0, location.href.lastIndexOf('/')+1);
            var url = dir + "MazeMania.jnlp";
            deployJava.createWebStartLaunchButton(url, '1.6.0');
        </script>
    </body>
    
    </html>
    My jnlp file looks like this:

    Java Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" 
        codebase="http://www.shahspace.com/JWS/MazeMania" 
        href="MazeMania.jnlp">
        <information>
            <title>Maze Mania</title>
            <vendor>Gibran shah</vendor>
        </information>
        <resources>
            <!-- Application Resources -->
            <j2se version="1.6+"
                  href="http://java.sun.com/products/autodl/j2se"/>
            <jar href="MazeMania.jar" main="true" />
    
        </resources>
        <application-desc
             name="Maze Mania"
             main-class="classes.Main">
         </application-desc>
         <update check="background"/>
    </jnlp>
    The jar file was created with the following command:

    jar cvf MazeMania.jar classes

    This was just above the classes folder. In the folder was the class file Main.class along with all subfolders containing class files belonging to whatever package was named after that folder. The jar file was then uploaded to my server.

    The problem is that when I try to launch this from the website, it says that it cannot find the Main class. Can anyone see why?

    P.S. - I tried changing main-class="classes.Main" to main-class="Main" but I get the same error.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,009
    Rep Power
    20

    Default

    I'm not sure, but can you do a web start program that isn't jarred?
    I don't think I've ever seen it.
    I think the whole point behind the resources section is to list all the jar files required to run the program, which includes the one with the program entry point (Main in your case).

Similar Threads

  1. web start in java
    By prabhug1987 in forum NetBeans
    Replies: 3
    Last Post: 04-28-2011, 10:39 AM
  2. Replies: 1
    Last Post: 01-18-2011, 06:27 PM
  3. Replies: 5
    Last Post: 03-20-2009, 10:04 PM
  4. Java Web Start
    By hitmen in forum New To Java
    Replies: 0
    Last Post: 03-11-2009, 11:42 AM
  5. Replies: 8
    Last Post: 05-28-2008, 07:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •