bad magic number

L

lawrence

I've been trying to install tinyScroller.class. I keep getting "bad
magic number" errors. Normally this happens when one doesn't upload in
binary format. I did upload in binary format, but I'm still gettting
the error.

What could another cause be?
 
L

lawrence

Roedy Green said:

The confusing part is that this is supposedly one of the most common
java applets in the world. This thing has, supposedly, been downloaded
and installed millions of times. And I've downloaded it from 5
different places, using different machines and different browsers, and
I never got a version that worked. And I was careful to upload it
again in binary format. And, I'm quite sure, there are people out
there with many years less experience than myself who are getting this
to work. So I have to wonder if I'm not missing something very
obvious.
 
L

lawrence

Roedy Green said:
Did you read the advice at that URL yet?

Yes, I read it when you suggested it. I thought I'd already thanked
you for that. I go now and look at it again, it reads, "The first few
bytes of class file are supposed to say CAFEBABE in hex. They don't.
Most likely the problem is you uploaded your class file to your Web
server using FTP ASCII mode instead of BINARY mode which mangled the
class file. There is a bug in the class library. Sometimes when a
class is not found it gets reported as corrupt instead. Novices get
this error when they try to run a program without compiling it first
e.g"

What I get from that is that I should recompile from the source code,
but I am in New Jersey this month, and my machine is in Virginia, so
that is not an easy option for me. I am trying to think of a way
around recompiling. It does seem to me like I should be able to
download this applet in a pre-compiled form. Let's face it, 99% of the
people who use Java Applets on the web don't know a damn thing about
compiling. If they can get it to work, I reason that I, too, should be
able to get it to work. But for some reason I'm not.

The question is now moot because last night I called one of my graphic
designer friends and they agreed to do something cool in Flash for me.
But, on an intellectual level, I'm curious about why I failed to
accomplish what so many others have, apparently, had no trouble with.
 
R

Roedy Green

What I get from that is that I should recompile from the source code,
but I am in New Jersey this month, and my machine is in Virginia, so
that is not an easy option for me. I am trying to think of a way
around recompiling. It does seem to me like I should be able to
download this applet in a pre-compiled form. Let's face it, 99% of the
people who use Java Applets on the web don't know a damn thing about
compiling. If they can get it to work, I reason that I, too, should be
able to get it to work. But for some reason I'm not.

It depends. If the audience is fellow programmers chances are you got
a *.java file and it needs compiling. If the audience is the end
user, you will have gotten a *.class or *.jar file. The uncompiled
form is a *.java. The compiled form is a *.class.


I take it you did not write this Applet. You just clicked on it in a
webpage. If so, it is not your fault. Email the author telling him
what you observed. HE is the one who likely uploaded it with FTP
incorrectly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top