Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7605859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:16:22+00:00 2026-05-31T00:16:22+00:00

Is it possible to set conditional path variables in Eclipse? This would be useful

  • 0

Is it possible to set conditional path variables in Eclipse? This would be useful for instance for a custom builder (which is stored with the project in Indigo – I think this wasn’t the case in old Eclipse versions) to call a different program under a different platform.

So what I’m looking for would be a something along the lines of:

${if{${system:OS}=='Windows'}compiler.exe${else}compiler.sh
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T00:16:23+00:00Added an answer on May 31, 2026 at 12:16 am

    If you would specifically like to invoke different compilers on different platforms, then you can use Ant or Make to detect your platform and call different programs.

    In your project’s properties, go to “Builders” and create a new build step. If you’re using GNU Make as a builder, you can use syntax like the following in your Makefile:

    # Only MS-DOS/Windows builds of GNU Make check for the MAKESHELL variable
    # On those platforms, the default is command.com, which is not what you want
    MAKESHELL := cmd.exe
    
    # Ask make what OS it's running on
    MAKE_OS := $(shell $(MAKE) -v)
    
    # On Windows, GNU Make is built using either MinGW or Cygwin 
    ifeq ($(findstring mingw, $(MAKE_OS)), mingw)
    BUILD_COMMAND := compiler.exe
    
    else ifeq ($(findstring cygwin, $(MAKE_OS)), cygwin)
    BUILD_COMMAND := compiler.exe
    
    else ifeq ($(findstring darwin, $(MAKE_OS)), darwin)
    BUILD_COMMAND := compiler-osx.sh
    
    else ifeq ($(findstring linux, $(MAKE_OS)), linux)
    BUILD_COMMAND := compiler.sh
    
    endif
    

    In Ant build scripts, conditional execution is determined by attributes like if, unless, and depends. The <os family=xxx> tag tells you what OS you’re running on. Here’s an example from devdaily:

    <?xml version="1.0"?>
    
    <!--
      An Ant build script that demonstrates how to test to see
      which operating system (computer platform) the Ant build
      script is currently running on. Currently tests for Mac OS X,
      Windows, and Unix systems.
      Created by Alvin Alexander, DevDaily.com
    -->
    
    <project default="OS-TEST" name="Ant Operating System Test" >
    
      <!-- set the operating system test properties -->
      <condition property="isMac">
        <os family="mac" />
      </condition>
    
      <condition property="isWindows">
        <os family="windows" />
      </condition>
    
      <condition property="isUnix">
        <os family="unix" />
      </condition>
    
      <!-- define the operating system specific targets -->
      <target name="doMac" if="isMac">
        <echo message="Came into the Mac target" />
        <!-- do whatever you want to do here for Mac systems -->
      </target>
    
      <target name="doWindows" if="isWindows">
        <echo message="Came into the Windows target" />
      </target>
    
      <target name="doUnix" if="isUnix">
        <echo message="Came into the Unix target" />
      </target>
    
      <!-- define our main/default target -->
      <target name="OS-TEST" depends="doMac, doWindows, doUnix">
        <echo message="Running OS-TEST target" />
      </target>
    
    </project>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to set a symbol for conditional compilation by setting up properties
Is it possible to set the data in a ContentPlaceHolder through code? This is
Will this be possible? In F# or C#? Both? For example, I would like
i would like to set up conditional logging for requests done over apaches mod_proxy.
Is it possible to conditionally set a dependency on a gem at install time?
In Java SE it is possible set the cause of an exception using initCause
Is possible to set an image as an iPhone application unique icon in code
Is it possible to set code behind a resource dictionary in WPF. For example
Is it possible to set the cursor to 'wait' on the entire html page
Is it possible to set the position of the tabs to be at the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.