如何在不添加全局路径的情况下让Eclipse / Ant了解Cygwin

时间:2022-09-07 22:51:10

I have a Java project in Eclipse, running on Windows. It uses ANT and has a target which invokes Linux tools like SCP/BASH. I've installed cygwin but since I haven't added it to my global path, Eclipse/ANT isn't aware.

我在Eclipse中有一个Java项目,在Windows上运行。它使用ANT并且有一个调用SCP / BASH等Linux工具的目标。我已经安装了cygwin,但由于我没有将它添加到我的全局路径中,Eclipse / ANT并不知道。

Where/how should I make individual projects aware that my cygwin/bin dir should be on their path?

在哪里/如何让个别项目意识到我的cygwin / bin目录应该在他们的路径上?

1 个解决方案

#1


0  

My first thought is that you should set up an ant or program config in your [Tools -> External tools] config. This wouldn't work on a project-by-project basis though.

我首先想到的是你应该在[工具 - >外部工具]配置中设置一个蚂蚁或程序配置。但这不会在逐个项目的基础上发挥作用。

Regarding doing it on a project-by-project basis though, I'm not really sure if you can. Ordinarily, the project tool-chain is determined by the project type you select. That is, you select [New -> Java Project] and you're provided with config to configure the JRE to use, etc.

关于逐个项目的做法,我不确定你是否可以。通常,项目工具链由您选择的项目类型决定。也就是说,您选择[New - > Java Project]并为您提供配置以配置要使用的JRE等。

So, I suspect that to do what you're asking on a project-by-project basis, you'd need to create a new Eclipse project template. This means creating a plugin for your new project-type that will allow you to configure your environment configured with the toolchain you want.

因此,我怀疑要逐个项目地执行您所要求的工作,您需要创建一个新的Eclipse项目模板。这意味着为您的新项目类型创建一个插件,允许您配置使用所需工具链配置的环境。

I'm not an expert but this post may be helpful: Eclipse CDT - new template or "project type".

我不是专家,但这篇文章可能会有所帮助:Eclipse CDT - 新模板或“项目类型”。

#1


0  

My first thought is that you should set up an ant or program config in your [Tools -> External tools] config. This wouldn't work on a project-by-project basis though.

我首先想到的是你应该在[工具 - >外部工具]配置中设置一个蚂蚁或程序配置。但这不会在逐个项目的基础上发挥作用。

Regarding doing it on a project-by-project basis though, I'm not really sure if you can. Ordinarily, the project tool-chain is determined by the project type you select. That is, you select [New -> Java Project] and you're provided with config to configure the JRE to use, etc.

关于逐个项目的做法,我不确定你是否可以。通常,项目工具链由您选择的项目类型决定。也就是说,您选择[New - > Java Project]并为您提供配置以配置要使用的JRE等。

So, I suspect that to do what you're asking on a project-by-project basis, you'd need to create a new Eclipse project template. This means creating a plugin for your new project-type that will allow you to configure your environment configured with the toolchain you want.

因此,我怀疑要逐个项目地执行您所要求的工作,您需要创建一个新的Eclipse项目模板。这意味着为您的新项目类型创建一个插件,允许您配置使用所需工具链配置的环境。

I'm not an expert but this post may be helpful: Eclipse CDT - new template or "project type".

我不是专家,但这篇文章可能会有所帮助:Eclipse CDT - 新模板或“项目类型”。