aspose file tools*
The moose likes Applets and the fly likes Compiling applets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Compiling applets " Watch "Compiling applets " New topic
Author

Compiling applets

Sameera Abeysinghe
Ranch Hand

Joined: Nov 15, 2004
Posts: 104
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

Joined: Aug 26, 2005
Posts: 824
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



Lack of will power has caused more failure than lack of intelligence or ability.
My Blog | Red5 Resources | Technology Update | Daily Technology Tips
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
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.


Ping & DNS - my free Android networking tools app
Sunil Kumar Gupta
Ranch Hand

Joined: Aug 26, 2005
Posts: 824
It always show the error That

Conflict with 1.5 source
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Compiling applets