gpt4 book ai didi

Eclipse 设置为多种语言

转载 作者:行者123 更新时间:2023-12-02 10:15:03 25 4
gpt4 key购买 nike

我一直在各种学校项目中使用 Java、javaEE、c++、python 和 PHP 的 Eclipse 平台。现在我对它更加熟悉了,我想获得一些关于如何设置它的更准确的说明。我使用的是 windows7 - 我已将 Eclipse 本身放入我的 Dropbox 中并根据需要创建了工作区,但这最终导致设置困惑,并且出现各种错误(当我尝试更新到 Juno 时出现 - 现在功能例如templates are broken)。

那么为各种语言设置 Eclipse 的推荐方法是什么?我是不是该下载最新版本,添加我需要的插件(cdt、pdt 等),然后为不同语言创建不同的工作区(如 eclipse_python、eclipse_java、eclipse_javaEE 等)?如何设置 Eclipse?

最佳答案

我已经密集使用 Eclipse 大约 6 年了,我建议为最多 1 或 2 种不同的编程语言设置单独的 Eclipse 安装。原因是插件太多,Eclipse 可能会消耗太多内存或处理器时间(当然,这取决于插件在后台执行的操作等等...),这可能会导致 UI 无响应。

我还建议为每个 Eclipse 安装使用单独的工作区,以便不同的配置/安装不会相互干扰。

我编写了一个小命令行脚本,它允许我切换工作区中的 .metadata 目录以与可移植驱动器一起使用(支持两种模式:家庭模式和可移植模式)也许有人发现这很有用...

@ECHO OFF

REM This Script is used to ease using eclipse in a portable manner
REM The script allows to easily switch between several workspace metadata

REM arg1: eclipse runnable
REM arg2: workspace dir
REM arg3: metadata mode (portable or home)

:CHECK_ARG_ONE
IF %1 == "" GOTO :HELP
IF /i %1 == "/h" GOTO :HELP
IF /i %1 == "/?" GOTO :HELP
IF /i %1 == "/help" GOTO :HELP
IF /i %1 == "-h" GOTO :HELP
IF /i %1 == "-?" GOTO :HELP
IF /i %1 == "-help" GOTO :HELP
IF /i %1 == "--h" GOTO :HELP
IF /i %1 == "--?" GOTO :HELP
IF /i %1 == "--help" GOTO :HELP


:CHECK_ARG_TWO
IF %2 == "" GOTO :ERROR_ARG_TWO


:CHECK_ARG_THREE
IF %3 == "" GOTO :ERROR_ARG_THREE


:PREPARE
SET "ECLIPSE_RUNNABLE=%1"
SET "WORKSPACE_DIR=%2"
ECHO Working Dir: %CD%
ECHO Eclipse Runnable: %ECLIPSE_RUNNABLE%
ECHO Workspace Dir: %WORKSPACE_DIR%
SET "MD=.metadata"
SET "MD_HOME=.metadata_home"
SET "MD_PORTABLE=.metadata_portable"
PUSHD %WORKSPACE_DIR%
IF /i %3 == home GOTO :HOME
IF /i %3 == portable GOTO :PORTABLE
GOTO :ERROR_ARG_THREE_WRONG


:HOME
ECHO Starting home version
IF EXIST %MD% (
IF EXIST %MD_HOME% (
IF EXIST %MD_PORTABLE% (
GOTO :ERROR_MD_PORTABLE_EXISTS_ALREADY
) ELSE (
REN %MD% %MD_PORTABLE%
REN %MD_HOME% %MD%
)
)
) ELSE (
IF NOT EXIST %MD_HOME% (
GOTO :ERROR_MD_HOME_EXISTS_NOT
) ELSE (
REN %MD_HOME% %MD%
)
)
GOTO :RUN


:PORTABLE
ECHO Starting portable version
IF EXIST "%MD%" (
IF EXIST "%MD_PORTABLE%" (
IF EXIST "%MD_HOME%" (
GOTO :ERROR_MD_HOME_EXISTS_ALREADY
) ELSE (
REN "%MD%" %MD_HOME%
REN "%MD_PORTABLE%" %MD%
)
)
) ELSE (
IF NOT EXIST "%MD_PORTABLE%" (
GOTO :ERROR_MD_PORTABLE_EXISTS_NOT
) ELSE (
REN "%MD_PORTABLE%" %MD%
)
)
GOTO :RUN


:ERROR_ARG_TWO
ECHO No second argument supplied (workspace dir)
GOTO :END_ERROR


:ERROR_ARG_THREE
ECHO No third argument supplied (metadata mode - home ^| portable)
GOTO :END_ERROR


:ERROR_ARG_THREE_WRONG
ECHO Supplied third argument (metadata mode) must match (home ^| portable)
GOTO :HELP


:ERROR_MD_HOME_EXISTS_ALREADY
ECHO Trying to rename "%MD%", but the metadata directory "%MD_HOME%" already exists!
GOTO :END_ERROR


:ERROR_MD_HOME_EXISTS_NOT
ECHO Neither "%MD%" nor "%MD_HOME%" exist!
GOTO :END_ERROR


:ERROR_MD_PORTABLE_EXISTS_ALREADY
ECHO Trying to rename "%MD%", but the metadata directory "%MD_PORTABLE%" already exists!
GOTO :END_ERROR


:ERROR_MD_PORTABLE_EXISTS_NOT
ECHO Neither "%MD%" nor "%MD_PORTABLE%" exist!
GOTO :END_ERROR


:HELP
ECHO.
ECHO Eclipse starter script to switch between home and portable metadata
ECHO ©Till Kolditz 2011 (till.kolditz@googlemail.com)
ECHO.
ECHO This Script is used to ease using eclipse in a portable manner.
ECHO It allows to easily switch between portable and "home" or stationary
ECHO workspace metadata.
ECHO.
ECHO Usage: run.bat (eclipse_runnable) (workspace_dir) (home ^| portable)
ECHO.
ECHO Example1: run.bat eclipse\eclipse.exe workspace home
ECHO Example2: run.bat "eclipse (x64)\eclipse.exe" workspace_special portable
GOTO :END


:RUN
POPD
START "Eclipse" %ECLIPSE_RUNNABLE% -data %WORKSPACE_DIR%
GOTO :END


:END_ERROR
POPD
REM PAUSE for debugging
PAUSE
GOTO :END


:END
GOTO :EOF

关于Eclipse 设置为多种语言,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11709683/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com