facebook

Compile error on JDK1.4

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #284782 Reply

    I am not sure if this is the correct place to post my issue or not.
    But I am desperate to get an answer, please let me know if someone can help.

    Here I go…I am using MyEclipse 6.01 & JDK1.5.

    If I force MyEclipse to use 1.4 compiler, and I use some JDK 1.5 provided features in my code,i.e.methods like getGenericType,MyEclipse does not show compile time errors.

    PS : I am forcing MyEclipse6.02 to use JDK1.4 compiler by
    Windows->Preferences->Java->Compiler->Comipler compliance leve 1.4

    But If I try to compile the code outside of MyEclipse,It throws compile errors for trying to compile JDK1.5 features on JDK1.4.

    Could anyone please let me know,why it is happening with the MyEclipse?

    #284792

    Loyal Water
    Member

    Are you working on a Java EE 5 web project or some other project?

    #284795

    I am using J2EE 1.4

    #284801

    Loyal Water
    Member

    Can you right click on your project and go to Properties > Java Complier and check the complier compliance level for your project. What level is selected in the dropdown ?

    Also, please switch to a new workspace (FIle > Switch Workspace >Temp), create a new J2EE 1.4 project with JDK compliance 1.4 and check if the issue gets resolved.

    #284802

    Compiler compliance level is 1.4.
    The behavior of compiling is same even if it is 5.0 or 1.4.It compiles JDK 1.5 features.

    #284805

    Here is the sample code :
    import java.util.ArrayList;

    public class test5feature {

    Object objA = new A();
    Class c = objA.getClass();

    java.lang.reflect.Field [] field1 = c.getDeclaredFields();

    public static void main(String [] args){
    method1();
    }
    private static void method1(){
    test5feature obj = new test5feature();
    if(obj.field1[0].getGenericType().equals(“String”)){
    System.out.println(“It’s string type”);
    }
    }
    }
    class A {
    private String data1 = null;
    private ArrayList data2 = null;
    }

    #284808

    Loyal Water
    Member

    Right Click on your project and go to Build Path > Java Build Path > Libraries and remove the Java EE 5 libraries. Now go to Add Library > MyEclipse Libraries > J2EE 1.4 libs. Now does it work the way you want ?

    #284823

    I found no JAVA EE 5 Libraries in the Java build path for my project.It has J2EE 1.4 Libraries & JRE System library.

    #285111

    Could anyone please help me on this?I am still trying to find it out why this is happening.

    #285220

    Loyal Water
    Member

    This message has not been recovered.

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: Compile error on JDK1.4

You must be logged in to post in the forum log in