Solved

Applet not running for most users

Posted on 2003-11-20
9
374 Views
Last Modified: 2010-03-31
I recently entered the world of applet creation. My applets run just fine on my machine, and on several friends' machines. However, for the vast majority of users, apparently regardless of OS and browser, they do not work.

I'm compiling my applet using Sun's JDK, and I've tried versions 1.2.2, 1.3.1_05, and 1.4.0_03. It doesn't seem to make any difference. Note that most users who CAN see my applet, are in the same Comp Sci classes as me, and have installed Sun's JDK themselves.

I created a version of my page that prompts users to download the JRE, and if they download it, all my applets DO work. However this is a huge hassle for users and it seems like it should be unnecessary; there's an awful lot of applets online that already work for nearly all users without requiring that download.

Should I be using a different compiler/different SDK? Perhaps different compiler options? I've already told the compiler to target an earlier version, and that didn't make any difference.
0
Comment
Question by:Sowelu
  • 5
  • 3
9 Comments
 

Author Comment

by:Sowelu
Comment Utility
Some clarification:
For users that the applet does not run, they get the error "load: class RunAlpha not found", where RunAlpha is my class. They get a grey box in place of the applet. Of course, the class does exist, and people with the JRE can load it. Apparently this is Java's standard "I don't like that file" error message.
I have attempted to compile under jdk1.1.8 but my program will not compile with it, I need features from later versions.
0
 
LVL 35

Accepted Solution

by:
TimYates earned 150 total points
Comment Utility
You need to ensure you aren't using any of the Java 1.2+ things when you create your applet

then compile it with -target=1.1

Basically, no ArrayLists, Iterators, Graphics2D, etc...

Or...you can download the old 1.1 JDK, and compile your applet with that (fixing it so it compiles for 1.1)

http://java.sun.com/products/archive/index.html
(you want http://java.sun.com/products/archive/jdk/1.1.8_010/index.html)

Basically, IE ships with 1.1 (or nothing under XP)...  in the case of XP, they will have to download the plugin...  In other cases, compiling as a properly compliant 1.1 applet should work...

If you can, it's probably worth getting users to download the JRE (plugin), as then you can use the new nicer functions in your applets (and graphics looks nicer)...

Or maybe supply them with a CD containing the plugin?
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
> I have attempted to compile under jdk1.1.8 but my program will not compile with it,
> I need features from later versions.

Then users will also need the plugin to run it.
The MS VM only supports 1.1.

Alternatively remove use of >1.1 features from your applet.
0
 
LVL 35

Expert Comment

by:TimYates
Comment Utility
> but my program will not compile with it, I need features from later versions.

In that case, people are going to have to install the plugin...

As I said, there are 2 options

1)  Make your code 1.1 compliant
2)  Make the users download the plugin

(2) is probably the better choice, as the user will get a more complete, smoother looking applet...  and they should only have to download the plugin about once a year (at most) ;-)

Tim
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:Sowelu
Comment Utility
Ah, okay. When I tried to compile under 1.1, it was exactly those ArrayLists that kept it from compiling. I don't need them in my program and I'm sure it's better off without them.

Unfortunately, since this is just an app I'm doing for fun, distributing a CD with the plugin isn't really an option... But if it's necessary to use >1.1 stuff, at least now I know that's what's wrong.

Thanks!
0
 
LVL 35

Expert Comment

by:TimYates
Comment Utility
> I don't need them in my program and I'm sure it's better off without them.

You can use Vector...it is similar :-)
0
 
LVL 35

Expert Comment

by:TimYates
Comment Utility
Good luck!

Tim
0
 

Author Comment

by:Sowelu
Comment Utility
Just managed to test it on an old machine and it DOES work when compiled for 1.1. Thanks again.

Once again, I learn that college does not truly prepare a person for the real world! ;)
0
 
LVL 35

Expert Comment

by:TimYates
Comment Utility
>  learn that college does not truly prepare a person for the real world!

:-)

It's a very good start though :-)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now