facebook

[Closed] JRE Version Conflict between Eclipse and ANT

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #260298 Reply

    msl
    Member

    Hello there,

    with the latest Update of myEclipse if got an annoying Bug(?!?).
    When i built my project with strg+B or autobulit its seems to be compiled in a different way the ANT script is doing.
    I create a JAR file with some sources from another project in my workspace and deploy it to my applicationserver.
    When starting i got the Java Version Error. Seems like internally myEclipse is compiling with JRE5 (whereever it takes the binaries because i deinstalled them from my machine) even if i set up the project with jre1.4.

    As a test I created a new Workspace with a Java Project. As JRE I switched to 1.4. Autobuilt enabled.
    When i try to run it fails because of the mentioned Errors. I run the Class with JRE1.5 it works fine.

    Figured the problem out with Eclipse 3.2 – but even with 3.2.1 its still the same.

    After uninstalling jre1.5 and deleting it from eclispe XML files so that its not selectable the mentioned test worked out – but still no clue for the JAR problem 🙁

    Any helps would be great

    cheers
    msl

    #260496 Reply

    Riyad Kalla
    Member

    When starting i got the Java Version Error. Seems like internally myEclipse is compiling with JRE5 (whereever it takes the binaries because i deinstalled them from my machine) even if i set up the project with jre1.4.

    If it is, this setting is controlled under your project properties and then Java Compiler. You can set this setting at a project or workspace level. Eclipse uses an internal Java compiler so even if you don’t have the JDK installed, it can still produce Java 5 code.

    #260530 Reply

    msl
    Member

    Eclipse uses an internal Java compiler so even if you don’t have the JDK installed, it can still produce Java 5 code.

    Well this seems to be the problem!
    Even if I choose a different JRE in Eclipse settings the problems pop up.

    Its like Eclipse uses the internal to build/autobuild the Sources and the ANT uses the JRE configured in ANT settings.
    Maybe some settings will be dropped during workspace init?

    The problem started with the install of latest myEclipse version….

    cheers

    msl

    #260565 Reply

    Riyad Kalla
    Member

    msl,
    I don’t really have any more suggestions for you. The way these compilers interact is:

    Ant -> Uses JDK tools.jar file to execute the javac task. So whatever JDK you run it with, it uses to compile your source.
    Eclipse/MyEclipse -> Uses the internal JDT compiler that can be configured on a per project or per workspace basis. You might want to double check that your settings are sticking (for example, if you are configuring this at a workspace level, but overriding it at a project level, that will cause a problem depending on the versions selected for each).

    What you need to do now is get everything in sync and make sure everyone’s versions are jiving.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: [Closed] JRE Version Conflict between Eclipse and ANT

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