The Artima Developer Community
Sponsored Link

Java Answers Forum
running applets

1 reply on 1 page. Most recent reply: Apr 7, 2005 11:25 AM by Amol Brid

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
cBin

Posts: 13
Nickname: cbb
Registered: Mar, 2005

running applets Posted: Apr 7, 2005 9:08 AM
Reply to this message Reply
Advertisement
I'm having trouble getting an applet to run on a computer other than my own. I wrote it in NetBeans, and it runs fine in the applet viewer. I then wrote the html file for it, and put the html file in a folder on my desktop with the .class file, and the .jar file.

I can run the applet in my web browser from this folder just by opening up the html file, and it works fine if it is on my computer, but when I try to open it on the computer at school it says "loading Java Applet Failed" on the browser, and if I open up the java console it has this error

java.lang.UnsupportedClassVersionError: BallBounce (Unsupported major.minor version 49.0)

and then a lot of errors like this
at sun.applet.AppletClassLoader.findClass(Unknown Source)


I am using JDK 5.0, could this be the problem? the version at school is:
Java(TM) Plug-in: Version 1.4.2_05
Using JRE version 1.4.2_05 Java HotSpot(TM) Client VM

I went to some sites that have java applets on them, and they open up just fine with the browser at school. Anyone know of a site which has an applet built in 5.0?

I am very confused, and unfortunatly don't have a web page to just test this on properly.

Here is my HTML:

 
<HTML>
<HEAD>
   <TITLE>Bouncing Ball Model Applet</TITLE>
</HEAD>
<BODY>
 
 
<H3><HR WIDTH="100%">Bouncing Ball Model<HR WIDTH="100%"></H3>
 
<P>
<APPLET code="BallBounce.class" 
        archive="BouncingBallApplet.jar"
        width=600 height=450></APPLET>
</P>
 
 
</BODY>
</HTML>


Any suggestions would be much apprecieated, this is driving me crazy.


Amol Brid

Posts: 43
Nickname: amolbrid
Registered: Feb, 2004

Re: running applets Posted: Apr 7, 2005 11:25 AM
Reply to this message Reply
Hi,

Compile your applet code using -target option.

For compiling to VM 1.4 use the following:

javac -target 1.4 <java source file>


Other VM versions are: 1.3, 1.2, 1.1

Regards,
Amol Brid.

Flat View: This topic has 1 reply on 1 page
Topic: layer implementation Previous Topic   Next Topic Topic: Isolate 2nd or 3rd instance of .indexOf(something)

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use