Dissolve Jello in 3 cups of water and add pineapple.
Pour into a 13x9 glass dish and chill until almost set, about 45 minutes - 1 hour.
In a mixing bowl, beat cream cheese and cool whip until smooth.
Carefully spread over jello and chill for 30 minutes.
In a saucepan over medium heat, combine sugar, lemon juice, water, flour, egg yolks and reserved pineapple juice and bring to a boil, stirring constantly.
Cook about 1 minute or until mixture thickens then allow it to cool.
Carefully spread above mixture over cream cheese layer and chill for at least an hour before serving.