Bug 495617 - Mars: Honor External Tools Configurations "Classpath | Ant Home" and "JRE | Separate JRE" (work with JavaSE-1.6)
Summary: Mars: Honor External Tools Configurations "Classpath | Ant Home" and "JRE | S...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 4.5.1   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 4.6.2   Edit
Assignee: Sarika Sinha CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 412254
Blocks:
  Show dependency tree
 
Reported: 2016-06-07 13:25 EDT by Mike McAngus CLA
Modified: 2019-12-15 09:16 EST (History)
3 users (show)

See Also:
markus.kell.r: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike McAngus CLA 2016-06-07 13:25:58 EDT
In Luna and Mars, when one tries to run ant and its compile task using Java < 7, one would get the "JRE version less than 1.7 is not supported" pop-up.

In Luna, one could work around this issue in the External Tools Configurations by changing the Ant Home in the Classpath tab to an earlier version of Ant, and by using a separate JRE in the JRE tab.

This work around no longer works in Mars.  Please fix.

I should be able to compile my applications using older versions of Ant and Java combatible with my company's environment without having to hard-code the paths to those resources (which will, likely, be different for each developer) in the javac task call.
Comment 1 Sarika Sinha CLA 2016-06-10 02:52:04 EDT
Yes, If user changes the Ant Home, We should not put the restriction for Java >=1.7.
Comment 2 Sarika Sinha CLA 2016-08-01 02:24:07 EDT
Moving to M2, As I am not getting a consistent output from ANT_HOME and DEFAULT_CLASSPATH  attributes from the configuration.
Comment 3 Sarika Sinha CLA 2016-09-12 02:14:58 EDT
Moving to M4, as M3 is dedicated for Java 9 work.
Comment 4 Sarika Sinha CLA 2016-10-26 04:50:48 EDT
I was working on removing the error if ant Home is not default and JRE is used less than 7, I was able to get the error removed but it is not enough to actually run Ant 1.7.1 on JDK 1.6 in eclipse. We get back the same error as mentioned in Bug 421423.

As remote.jar is compiled with 1.7, it will fail as it can not find the main class.
Comment 5 Sarika Sinha CLA 2016-10-28 05:39:42 EDT
I am trying to compile remote.jar with 1.6 as we do in  jdt launching.
Comment 6 Mike McAngus CLA 2016-10-28 09:07:39 EDT
I know this is late in the game, but have you looked at the solution at http://blog.sibvisions.com/2015/09/25/eclipse-mars-with-ant-and-jre-6-story/
Comment 7 Eclipse Genie CLA 2016-11-07 10:12:59 EST
New Gerrit change created: https://git.eclipse.org/r/84580
Comment 9 Sarika Sinha CLA 2016-11-08 05:13:11 EST
(In reply to Eclipse Genie from comment #8)
> Gerrit change https://git.eclipse.org/r/84580 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.git/commit/
> ?id=5f1a8c148f2ea2a523ccff79078bdc64925d9078

Have released the changes to Master. After testing in the build, can be released in 4.6.2
Comment 10 Markus Keller CLA 2016-11-08 07:16:39 EST
The 3 JARs whose setup was touched are now always dirty after the project got cleaned. That should be avoided.

We've solved this problem for /org.eclipse.jdt.ui/jar-in-jar-loader.zip by adding a
<target name="dummy_clean"/>
task to the Ant build file and configuring this task in the Ant builder for the "After a Clean" event.

The build for the /org.eclipse.ant.ui/lib/remoteAnt.jar fails with compile errors in my workspace (misses SWT on the classpath, maybe happens because I have SWT from source):


Buildfile: C:\e\w\master\git\eclipse.platform\ant\org.eclipse.ant.ui\buildfiles\buildRemoteExtraJAR.xml

init:

clean:

lib/remoteAntLib.jar:
       [mkdir] Created dir: C:\e\w\master\git\eclipse.platform\ant\org.eclipse.ant.ui\temp.folder\lib\remoteAnt.jar.bin
       [javac] Compiling 3 source files to C:\e\w\master\git\eclipse.platform\ant\org.eclipse.ant.ui\temp.folder\lib\remoteAnt.jar.bin
       [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.6
       [javac] C:\e\w\master\git\eclipse.platform\ant\org.eclipse.ant.ui\Remote Ant Support\org\eclipse\ant\internal\ui\antsupport\inputhandler\SWTInputHandler.java:19: error: package org.eclipse.swt does not exist
       [javac] import org.eclipse.swt.SWT;
       [javac]                       ^
[...]

You probably have to restore the <javac><classpath> element that was removed with the change in bug 412254.
Comment 11 Markus Keller CLA 2016-11-08 13:13:35 EST
(In reply to Markus Keller from comment #10)
> The build for the /org.eclipse.ant.ui/lib/remoteAnt.jar fails with compile
> errors in my workspace (misses SWT on the classpath, maybe happens because I
> have SWT from source)

Same compile errors in a new workspace.

Note that the classpath entries that were wrongly removed in bug 412254 tried to get SWT dependencies from the workspace as well as from the currently running eclipse install. The workspace entries need to be updated to the current project layout in Git.

Furthermore, we should set the JDTCompilerAdapter if possible, so that we don't depend on unknown compilers. I don't really expect something like https://www.win.tue.nl/~aeb/linux/hh/thompson/trust.html , but using our own products is always a plus.

Done that with http://git.eclipse.org/c/platform/eclipse.platform.git/commit/?id=473f76a3899fe6917daf16b767649475c4518351
Comment 12 Sarika Sinha CLA 2016-11-10 00:33:35 EST
http://git.eclipse.org/c/platform/eclipse.platform.git/commit/?id=470058dd447650595dff204ea3b668cd6645deff

Removed entry of 3 jars (remoteAnt.jar, remote.jar and antdebug.jar) from build.properties as we are compiling it locally with 1.6 and we don't want Tycho to rebuild it.
Comment 13 Eclipse Genie CLA 2016-11-10 06:47:15 EST
New Gerrit change created: https://git.eclipse.org/r/84797
Comment 15 Markus Keller CLA 2016-11-10 07:14:20 EST
(In reply to Eclipse Genie from comment #14)
The fix for bug 507345 was this line in /org.eclipse.ant.launching/build.properties:

extra.lib/loggers.jar = lib/antdebug.jar

The loggers.jar needs the antdebug.jar on the classpath at build time.
Comment 16 Sarika Sinha CLA 2016-11-11 03:24:59 EST
Verified in 4.7 build
Eclipse SDK

Version: Oxygen (4.7)
Build id: I20161110-2030

Will be pushing the same changes to 4.6.2.

Dane can you do a +1 ?
Comment 17 Sarika Sinha CLA 2016-11-11 04:38:56 EST
Bundle version increase in master for ant.launching and ant.ui
http://git.eclipse.org/c/platform/eclipse.platform.git/commit/?id=6ebec20ef7c9d702fada14937494334eba26b6af
Comment 18 Dani Megert CLA 2016-11-11 05:58:18 EST
(In reply to Sarika Sinha from comment #16)
> Verified in 4.7 build
> Eclipse SDK
> 
> Version: Oxygen (4.7)
> Build id: I20161110-2030
> 
> Will be pushing the same changes to 4.6.2.
> 
> Dane can you do a +1 ?

Please provide a Gerrit change.
Comment 19 Sarika Sinha CLA 2016-11-14 05:37:33 EST
https://git.eclipse.org/r/84970

Added gerrit Change for R4_6 Maintenance.

As the changes were not available for direct cherry pick, it will be good if Markus can review as we are in RC2 now.
Comment 20 Eclipse Genie CLA 2016-11-14 09:57:14 EST
New Gerrit change created: https://git.eclipse.org/r/84970
Comment 21 Eclipse Genie CLA 2016-11-15 06:55:29 EST
Gerrit change https://git.eclipse.org/r/84970 was merged to [R4_6_maintenance].
Commit: http://git.eclipse.org/c/platform/eclipse.platform.git/commit/?id=8b56f68f6aff9cb0630e485dd22d6e5861b38578
Comment 22 Eclipse Genie CLA 2016-11-15 06:55:30 EST
Gerrit change https://git.eclipse.org/r/84970 was merged to [R4_6_maintenance].
Commit: http://git.eclipse.org/c/platform/eclipse.platform.git/commit/?id=8b56f68f6aff9cb0630e485dd22d6e5861b38578
Comment 23 Eclipse Genie CLA 2016-11-15 06:55:30 EST
Gerrit change https://git.eclipse.org/r/84970 was merged to [R4_6_maintenance].
Commit: http://git.eclipse.org/c/platform/eclipse.platform.git/commit/?id=8b56f68f6aff9cb0630e485dd22d6e5861b38578
Comment 24 Markus Keller CLA 2016-11-15 07:02:14 EST
(In reply to Sarika Sinha from comment #19)
> As the changes were not available for direct cherry pick, it will be good if
> Markus can review as we are in RC2 now.

I cherry-picked all 4 commits that mentioned this bug in the proper order (oldest to newest). I didn't get any conflicts, so I squashed the commits and updated the bundle versions.

When I compared this to https://git.eclipse.org/r/#/c/84970/1 , the only changes were unnecessary formatting changes, bad indentations, and bugs in the src.includes in both build.properties files.

I've pushed my commit (once, the other two comments are bug 507536).
Comment 25 Sarika Sinha CLA 2016-11-15 23:57:36 EST
Verified using
Eclipse SDK

Version: Neon.2 (4.6.2)
Build id: M20161115-1315