• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Rob Spoor
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:

Bad Major Version Number

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 24204
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much for considering my question and for for your clear answer.

Ko
 
Today's lesson is that you can't wear a jetpack AND a cape. I should have read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic