Arrange listed libraries to have Java libraries first