Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7890961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:29:35+00:00 2026-06-03T06:29:35+00:00

I have a very simple java applet that I took from here: http://docs.oracle.com/javase/tutorial/deployment/applet/subclass.html import

  • 0

I have a very simple java applet that I took from here: http://docs.oracle.com/javase/tutorial/deployment/applet/subclass.html

import javax.swing.JApplet;
import javax.swing.SwingUtilities;
import javax.swing.JLabel;

public class HelloWorld extends JApplet {
    //Called when this applet is loaded into the browser.
    public void init() {
        //Execute a job on the event-dispatching thread; creating this applet's GUI.
        try {
            SwingUtilities.invokeAndWait(new Runnable() {
                public void run() {
                    JLabel lbl = new JLabel("Hello World");
                    add(lbl);
                }
            });
        } catch (Exception e) {
            System.err.println("createGUI didn't complete successfully");
        }
    }
}

I can get the applet to run in eclipse when I right click and do Run As > Java Applet but now I’m trying to put it into a jar file and run it using jnlp through the browser. These are the steps I’ve taken to try and do that:

  1. javac -d build HelloClass.java
  2. cd build
  3. jar cvf Hello.jar *.class
  4. Create Hello.jnlp file:
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="" href="">
        <information>
            <title>Hello Applet</title>
            <vendor>Self</vendor>
        </information>
        <resources>
            <!-- Application Resources -->
            <j2se version="1.6+"
                href="http://java.sun.com/products/autodl/j2se" />
            <jar href="Hello.jar" main="true" />

        </resources>
        <applet-desc 
             name="Hello Applet"
             main-class="HelloClass"
             width="300"
             height="300">
        </applet-desc>
        <update check="background"/>
    </jnlp>
  1. Create html page:
    <html>
    <head>
    <title>Hello Applet</title>
    </head>
    <body>
        <!-- ... -->
        <script src="http://www.java.com/js/deployJava.js"></script>
        <script> 
            var attributes = {
                code:'HelloClass',  width:300, height:300} ; 
            var parameters = {jnlp_href: 'Hello.jnlp'} ; 
            deployJava.runApplet(attributes, parameters, '1.6'); 
        </script>
        <!-- ... -->
    </body>
    </html>

When I open this page in my browser I get prompted to allow the applet to run but then I get a error with the following details:

Exception: java.lang.UnsupportedClassVersionError: HelloClass : Unsupported major.minor version 51.0
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T06:29:37+00:00Added an answer on June 3, 2026 at 6:29 am

    The code was apparently compiled by a 1.7 SDK without using any cross-compilation options, while the JRE that is trying to load it, is version 6 or less.

    To compile code for a particular Java version, use the cross-compilation options. To do this properly will require an rt.jar of the target version (to use the bootclasspath option of javac).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have very simple persistance.xml file: <?xml version=1.0 encoding=UTF-8?> <persistence version=1.0 xmlns=http://java.sun.com/xml/ns/persistence xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/persistence
I have a very simple Java RMI Server that looks like the following: import
I have a very simple command line Java application that I wish to port
I have a small (500kb) swing applet that displays very simple/limited set of small
Say I have a very simple java object that only has some getXXX and
I have a very simple batch file that lauches a Java app (Saxon) with
I have very simple form that gets values in JSON format from searchAlbum.php .
i have very simple problem. I need to create model, that represent element of
I have very simple select like this: SELECT * FROM table WHERE column1 IN
I have some very simple javascript code that looks like this: var newWindow =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.