• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compiling applets

 
Sameera Abeysinghe
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am using JDK 1.5 update 5. I code some applets and compiled it using 1.5. Any of the applets did not work in machines having JRE 1.4.2 so I had to uninstall 1.5 install 1.4.2 and recompiled my applets
Now my problem
Without uninstalling JDK 1.5 is there a way for me to compile my applets so that they can work in 1.4.2 JRE
May be a special compile time option so that thought the machine has 1.5 it actually output my applet in 1.4.2(or any version before)

Saying any one viewing this applet must download JRE 1.5 is not an option(according to my boss)

Thank You
 
Sunil Kumar Gupta
Ranch Hand
Posts: 824
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sameera Abeysinghe:
Hi all,

I am using JDK 1.5 update 5. I code some applets and compiled it using 1.5. Any of the applets did not work in machines having JRE 1.4.2 so I had to uninstall 1.5 install 1.4.2 and recompiled my applets
Now my problem
Without uninstalling JDK 1.5 is there a way for me to compile my applets so that they can work in 1.4.2 JRE
May be a special compile time option so that thought the machine has 1.5 it actually output my applet in 1.4.2(or any version before)

Saying any one viewing this applet must download JRE 1.5 is not an option(according to my boss)

Thank You




Answer is simple.

Just install jdk1.4.2 and simply set the env. varibale(Path) to point your 1.4.2 installation rather instead of your 1.5 installation.

And then compile your applet on 1.4.2. and distribute it . it will run on every machine having jre1.4.2


Enjoy

 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Installing and reinstalling JDKs doesn't sound all that simple.

Just use the "-target 1.4" option during compilation, and the resulting class files will be compatible with 1.4 JVMs. You need to take care not to use any Java 5 APIs, of course.
 
Sunil Kumar Gupta
Ranch Hand
Posts: 824
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It always show the error That

Conflict with 1.5 source
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's why I said to make sure not to use Java 1.5/5.0 APIs. A 1.4 JVM will not be able to use code based on 1.5.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic