Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Build Path Order (possiblya bug?)
Build Path Order (possiblya bug?) [message #636036] Fri, 29 October 2010 06:42 Go to next message
Michael Kebe is currently offline Michael KebeFriend
Messages: 1
Registered: July 2009
Junior Member
I don't know exactly if this is a bug, so I'll be posting this here.

I am using Helios with JDT (I think it is 3.6.0.v_A58).

To reproduce this to this:

1) Create a new Java project
2) Create a second and third source folder in project root (e.g. a and b)
3) Under "Java Build Path" of the project enable the "Allow output folders for source folders" and change the output folder of a to abin and of b to bbin.
4) Go to the "Order and Export" tab and change the order to "src, a, b, JRE System Library", if needed.
5) Run this main in the project:
public class Main {
	private static final String PATH_SEPARATOR = System.getProperty("path.separator");

	public static void main(String[] args) throws Throwable {
		String[] classpaths = System.getProperty("java.class.path").split(PATH_SEPARATOR);
		System.out.println(java.util.Arrays.toString(classpaths));
	}
}

I expected to see that the order of the class path is "bin, abin, bbin", but one get this order: "abin, bbin, bin".

Now play around with the order in the "Order and Export" tab und run the main again.

I looks for me, that the default output folder is always the last one in the classpath. If you change the output folder of src explicitly to "bin" the order is as expected.

What do you think?
Re: Build Path Order (possiblya bug?) [message #636083 is a reply to message #636036] Fri, 29 October 2010 09:13 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Michael Kebe wrote:
> I don't know exactly if this is a bug, so I'll be posting this here.
>
> I am using Helios with JDT (I think it is 3.6.0.v_A58).
>
> To reproduce this to this:
>
> 1) Create a new Java project
> 2) Create a second and third source folder in project root (e.g. a and b)
> 3) Under "Java Build Path" of the project enable the "Allow output
> folders for source folders" and change the output folder of a to abin
> and of b to bbin.
> 4) Go to the "Order and Export" tab and change the order to "src, a,
> b, JRE System Library", if needed.
> 5) Run this main in the project:
>
> public class Main {
> private static final String PATH_SEPARATOR =
> System.getProperty("path.separator");
>
> public static void main(String[] args) throws Throwable {
> String[] classpaths =
> System.getProperty("java.class.path").split(PATH_SEPARATOR);
> System.out.println(java.util.Arrays.toString(classpaths));
> }
> }
>
> I expected to see that the order of the class path is "bin, abin,
> bbin", but one get this order: "abin, bbin, bin".
>
> Now play around with the order in the "Order and Export" tab und run
> the main again.
>
> I looks for me, that the default output folder is always the last one
> in the classpath. If you change the output folder of src explicitly to
> "bin" the order is as expected.
>
> What do you think?
This is expected since n source folders can map to the default folder.
Therefore the launcher puts it at the end. We could be smarter and put
the output folder where the last source folder, mapping to it, is
positioned. Please file a bug report against JDT Debug if you need this
and cc me.

Dani
Previous Topic:gazillion dir's after a project import
Next Topic:Using visual annotations with JDT text editor
Goto Forum:
  


Current Time: Fri Apr 19 02:24:23 GMT 2024

Powered by FUDForum. Page generated in 0.01699 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top