Solved

Applet not running for most users

Posted on 2003-11-20
9
375 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
ID: 9792010
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
ID: 9792020
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
ID: 9792023
> 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
ID: 9792030
> 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Sowelu
ID: 9792056
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
ID: 9792063
> 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
ID: 9792065
Good luck!

Tim
0
 

Author Comment

by:Sowelu
ID: 9792099
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
ID: 9795609
>  learn that college does not truly prepare a person for the real world!

:-)

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
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…

861 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

26 Experts available now in Live!

Get 1:1 Help Now