• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Bad Major Version Number

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,

I just started to play with applets. I normally write code with j2sdk1.4.*. on winXP. Even if I stick to older (=no swing) stuff, I get a BAD MAJOR VERSION NUMBER when I check the applets with MAC OS9 + MR.J. Sometimes, just recompiling the same code on the mac produces a workable applet.
Does anybody knows a "trick" to compile "old" code on a modern PC+sdk, so that older browsers+ JRE run the applet, except installing the older jdk's of course?

Thank you for any advice!
 
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java compiler javac has a "-target" flag: you use it to tell the compiler what version class files it should generate. If for example, you're using j2sdk1.4, but you need your class files to work on 1.3 and above, then use "javac -target 1.3" to compile your classes.
 
Ko Wey
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much. This helps me on the way!
May I request a hint: what target should I use so that "nearly everyone can enjoy the applets (users of win98 FE with MS JRE, MasOS9, users without knowledge of plugins,...)
Ichecked the applets with MRJ 2.2 (mac OS9)- so what target that is, I don't know. (It's apparently not mentioned in the docs)
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To have everyone with a Java enabled browser able to use your applet without upgrading their browser plugin, you need to compile to 1.1 bytecode and not use JFC (Swing).

1.2 and 1.3 plugins (with Swing) should be available for most any platform.
1.4 plugins for most if not current production platforms since 2001 or so.
1.5 plugins currently only for Win32, Linux and Solaris (and a few 64 bit versions for some Linux and Win32 architectures as well as Solaris). 1.5 plugin for Mac OS/X is currently in closed (I think) beta for inclusion in Apple's NEXT OS version scheduled for (AFAIK) next year.
 
Ko Wey
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for considering my question and for for your clear answer.

Ko
    Bookmark Topic Watch Topic
  • New Topic