erlang 基于eclipse的 ide

游炳
2023-12-01
■环境
eclipse 3.6.2 或  eclipse-helios 版 [3.6.2优先,对erlide支持好一些] 
注意:装之前把项目中的.metadata删掉,重置eclipse,然后再安装,装完插件后一定要手动再重启一次

■安装 
Help -> Install New Software -> add -> http://erlide.org/update

■基本配置
Window / Preferences / General / Content Types / Text / Erlang source file / default encoding 填 utf-8 / Update / 确定
Window / Preferences / General / Workspace / utf-8
Window / Preferences / Erlang / install runtimes / add 找到erl的安装目录,选中后确定【也就是必须要装一个erlang虚拟机】
使用方法:
点击run右边的倒三角按钮,点Erlang会出现consoles面版,在其内调用函数即可,若未出现该面版则在Window/Show View/Console调出

■个性配置
新建项目,然后右击,在弹出的列表中选[property]

1、重定向编译目录,并忽略,以防被提交到SVN
property / Erlang / Output directory / Browse / [选中项目] / Create New Folder / 创建名为bin的文件夹 / ok
右击bin文件夹 / TortoiseSVN / Remove from ignore list / bin 即可忽略该文件夹

2、将src下的子目录也应用上语法提示,ctrl+点击等功能[erlide默认情况下对src的子目录无效]
property / Erlang / Sources directories / New / 依次将src的所有子目录添加即可



正常情况下,以上的操作是就能成功。  但是本人却碰到了蛋疼的问题。

  
  
13:57:29,405 F: (ErlangCore.java:77) : Starting CORE Thread[Worker-3,5,main] 13:57:29,411 I: (ErlangCoreLogger.java:43) : *** starting Erlide v0.20.3.201303132150 (core=0.20.0.201303132150) *** (GBK) 13:57:29,427 F: (ErlangCore.java:94) : Started CORE 13:57:29,510 F: (ErlangHostnameRetriever.java:110) : ?> 13:57:29,513 F: (ErlangHostnameRetriever.java:36) : Test long hostname: null 13:57:29,513 W: (ErlangHostnameRetriever.java:42) : Can't use null as long name 13:57:29,593 F: (ErlangHostnameRetriever.java:110) : ?> 13:57:29,596 F: (ErlangHostnameRetriever.java:36) : Test long hostname: Paulli_s 13:57:29,636 F: (ErlangHostnameRetriever.java:65) : Ping: foo1363413449515@Paulli_s 13:57:30,651 W: (ErlangHostnameRetriever.java:42) : Can't use Paulli_s as long name 13:57:30,709 F: (ErlangHostnameRetriever.java:110) : ?> 13:57:30,710 F: (ErlangHostnameRetriever.java:36) : Test short hostname: null 13:57:30,710 W: (ErlangHostnameRetriever.java:42) : Can't use null as short name 13:57:30,748 F: (ErlangHostnameRetriever.java:110) : ?> 13:57:30,748 F: (ErlangHostnameRetriever.java:36) : Test short hostname: Paulli_s 13:57:30,750 F: (ErlangHostnameRetriever.java:65) : Ping: foo1363413450711@Paulli_s 13:57:31,753 W: (ErlangHostnameRetriever.java:42) : Can't use Paulli_s as short name 13:57:47,456 F: (BackendFactory.java:48) : Create ide backend 13:57:47,461 I: (RuntimeData.java:307) : Data:: org.erlide.backend.BackendData 13:57:47,462 I: (RuntimeData.java:313) : PROJECT_NAME_SEPARATOR: ; 13:57:47,462 I: (RuntimeData.java:313) : beamLocator : null 13:57:47,462 I: (RuntimeData.java:313) : launch : null 13:57:47,463 I: (RuntimeData.java:313) : projects : [] 13:57:47,463 I: (RuntimeData.java:313) : cookie : erlide 13:57:47,463 I: (RuntimeData.java:313) : managed : true 13:57:47,464 I: (RuntimeData.java:313) : restartable : true 13:57:47,464 I: (RuntimeData.java:313) : startShell : true 13:57:47,464 I: (RuntimeData.java:313) : console : false 13:57:47,464 I: (RuntimeData.java:313) : interpretedModules : [] 13:57:47,465 I: (RuntimeData.java:313) : nodeName : 907d4_Administrator_c68144_erlide 13:57:47,465 I: (RuntimeData.java:313) : longName : false 13:57:47,465 I: (RuntimeData.java:313) : extraArgs : 13:57:47,466 I: (RuntimeData.java:313) : workingDir : D:/erlang 13:57:47,466 I: (RuntimeData.java:313) : env : {} 13:57:47,466 I: (RuntimeData.java:313) : initialCall : null 13:57:47,467 I: (RuntimeData.java:313) : debugFlags : [ATTACH_ON_BREAKPOINT] 13:57:47,467 I: (RuntimeData.java:313) : loadOnAllNodes : false 13:57:47,467 I: (RuntimeData.java:313) : internal : true 13:57:47,475 I: (RuntimeData.java:313) : runtimeInfo : Runtime<erl5.9 (F:\Program Files (x86)\erl\erl5.9.3) R15B03 []> 13:57:47,476 I: (RuntimeData.java:313) : debug : false 13:57:47,476 I: (RuntimeData.java:313) : reportErrors : false 13:57:47,476 I: (RuntimeData.java:323) : --------------- 13:57:47,477 F: (BackendFactory.java:78) : Create backend 907d4_Administrator_c68144_erlide 13:57:47,503 F: (ErlangLaunchDelegate.java:90) : doLaunch runtime erl5.9 13:57:47,503 F: (ErlangLaunchDelegate.java:91) : doLaunch cookie erlide (erlide) 13:57:47,504 I: (RuntimeData.java:307) : Data:: org.erlide.backend.BackendData 13:57:47,504 I: (RuntimeData.java:313) : PROJECT_NAME_SEPARATOR: ; 13:57:47,505 I: (RuntimeData.java:313) : beamLocator : org.erlide.model.BeamLocator@4261483d 13:57:47,505 I: (RuntimeData.java:313) : launch : org.eclipse.debug.core.Launch@cdbed7 13:57:47,505 I: (RuntimeData.java:313) : projects : [] 13:57:47,505 I: (RuntimeData.java:313) : cookie : erlide 13:57:47,506 I: (RuntimeData.java:313) : managed : true 13:57:47,506 I: (RuntimeData.java:313) : restartable : false 13:57:47,506 I: (RuntimeData.java:313) : startShell : true 13:57:47,507 I: (RuntimeData.java:313) : console : true 13:57:47,507 I: (RuntimeData.java:313) : interpretedModules : [] 13:57:47,507 I: (RuntimeData.java:313) : nodeName : 907d4_Administrator_c68144_erlide 13:57:47,507 I: (RuntimeData.java:313) : longName : false 13:57:47,508 I: (RuntimeData.java:313) : extraArgs : 13:57:47,508 I: (RuntimeData.java:313) : workingDir : . 13:57:47,508 I: (RuntimeData.java:313) : env : {} 13:57:47,509 I: (RuntimeData.java:313) : initialCall : <none> 13:57:47,509 I: (RuntimeData.java:313) : debugFlags : [ATTACH_ON_BREAKPOINT] 13:57:47,509 I: (RuntimeData.java:313) : loadOnAllNodes : false 13:57:47,510 I: (RuntimeData.java:313) : internal : true 13:57:47,511 I: (RuntimeData.java:313) : runtimeInfo : Runtime<erl5.9 (F:\Program Files (x86)\erl\erl5.9.3) R15B03 []> 13:57:47,511 I: (RuntimeData.java:313) : debug : false 13:57:47,512 I: (RuntimeData.java:313) : reportErrors : false 13:57:47,512 I: (RuntimeData.java:323) : --------------- 13:57:47,513 F: (ErlangLaunchDelegate.java:165) : START node :> ["F:\Program Files (x86)\erl\erl5.9.3/bin/erl", -sname, 907d4_Administrator_c68144_erlide@null, -setcookie, erlide] *** F:\program\code_edit\eclipse- 13:57:47,525 F: (ErlangLaunchDelegate.java:184) : process is running 13:57:47,531 F: (ErtsProcess.java:27) : # create ErtsProcess: 907d4_Administrator_c68144_erlide 13:57:47,533 F: (ErlangLaunchDelegate.java:144) : Started erts: 907d4_Administrator_c68144_erlide >> 907d4_Administrator_c68144_erlide 13:57:47,535 F: (ErlRuntime.java:376) : using cookie 'erlide...'6 (info: 'erlide') 13:57:47,539 F: (ErlRuntime.java:461) : 907d4_Administrator_c68144_erlide@null: waiting connection to peer... 13:57:47,554 F: (ErtsProcess.java:84) : ErtsProcess terminated: 907d4_Administrator_c68144_erlide 13:57:47,554 I: (ErtsWatcher.java:73) : Backend '907d4_Administrator_c68144_erlide' terminated with exit code 1. 13:57:47,641 F: (ErlRuntime.java:162) : # ping...907d4_Administrator_c68144_erlide@null main 13:57:50,593 F: (ErlRuntime.java:162) : # ping...907d4_Administrator_c68144_erlide@null main 13:57:50,995 F: (ErlRuntime.java:162) : # ping...907d4_Administrator_c68144_erlide@null main 13:57:51,398 F: (ErlRuntime.java:162) : # ping...907d4_Administrator_c68144_erlide@null main 13:57:51,799 F: (ErlRuntime.java:162) : # ping...907d4_Administrator_c68144_erlide@null main 13:57:52,202 F: (ErlRuntime.java:162) : # ping...907d4_Administrator_c68144_erlide@null main 13:57:52,605 F: (ErlRuntime.java:162) : # ping...907d4_Administrator_c68144_erlide@null main 13:57:53,006 F: (ErlRuntime.java:162) : # ping...907d4_Administrator_c68144_erlide@null main
如上图:erlang 进程 挂掉, ide连接不上erlang, eclipse 无限重试链接。 所以eclipse就像挂掉一样。 本人重试了N个版本的erlang,和 erlang ide 的更新地址。 都无效 最后,抱着最后一式的心态,重新下载了一个 otp_win64_R15B.exe 的erlang包。 即R15B(5.9)。 在设置了install runtimes后,惊喜的发现,成功了。
13:00:33,815 F: (ErlangCore.java:77) : Starting CORE Thread[Worker-3,5,main] 13:00:33,817 I: (ErlangCoreLogger.java:42) : *** starting Erlide v0.16.0.201204301337 (core=0.15.4.201204301337) *** (GBK) 13:00:33,829 F: (ErlangCore.java:94) : Started CORE 13:00:33,833 F: (ErlideUIPlugin.java:148) : Starting UI Thread[Worker-3,5,main] 13:00:33,833 F: (ErlideUIPlugin.java:155) : Started UI 13:05:02,157 F: (ErlModel.java:191) : makeErlangProject NewHall[> Erlang Model] 13:05:03,060 F: (ErlideBuilder.java:126) : ###** Starting build full of NewHall 13:05:03,066 F: (ErlideBuilder.java:147) : >>> compiler options ::: [debug_info,nowarn_export_all,nowarn_export_vars,nowarn_shadow_vars,warn_unused_function,warn_deprecated_function,nowarn_obsolete_guard,nowarn_unused_import,warn_unused_vars,warn_unused_record] 13:05:03,085 F: (ErlideBuilder.java:153) : Will compile 33 resource(s) 13:05:03,085 F: (BackendFactory.java:46) : Create build backend R15 13:05:03,096 F: (BackendFactory.java:53) : Create backend R15_af3dc_Administrator_96386e 13:05:03,102 F: (ErlangLaunchDelegate.java:84) : doLaunch runtime erl5.9 (erl5.9) 13:05:03,102 F: (ErlangLaunchDelegate.java:86) : doLaunch cookie erlide (erlide) 13:05:03,104 I: (GenericBackendData.java:51) : Backend data:run mode, with attributes:: 13:05:03,104 I: (GenericBackendData.java:61) : org.eclipse.debug.ui.ATTR_CONSOLE_ENCODING: ISO-8859-1 13:05:03,104 I: (GenericBackendData.java:61) : *..cookie : erlide 13:05:03,104 I: (GenericBackendData.java:61) : *..extra_args : 13:05:03,104 I: (GenericBackendData.java:61) : *..managed : true 13:05:03,105 I: (GenericBackendData.java:61) : *..nodeName : R15_af3dc_Administrator_96386e 13:05:03,105 I: (GenericBackendData.java:61) : *..runtime : erl5.9 13:05:03,105 I: (GenericBackendData.java:61) : process_factory_id : org.erlide.core.ertsProcessFactory 13:05:03,105 I: (GenericBackendData.java:66) : --------------- 13:05:03,106 F: (ErlangLaunchDelegate.java:163) : START node :> ["c:\program files\erl5.9/bin/erl", -name, R15_af3dc_Administrator_96386e@Paulli_s, -setcookie, erlide] *** D:\code\erlang\work 13:05:03,125 F: (ErlangLaunchDelegate.java:182) : process is running 13:05:03,132 F: (ErtsProcess.java:27) : # create ErtsProcess: R15_af3dc_Administrator_96386e 13:05:03,133 F: (ErlangLaunchDelegate.java:140) : Started erts: R15_af3dc_Administrator_96386e >> R15_af3dc_Administrator_96386e 13:05:03,140 F: (ErlRuntime.java:277) : using cookie 'erlide...'6 (info: 'erlide') 13:05:03,145 F: (ErlRuntime.java:102) : # ping...R15_af3dc_Administrator_96386e@Paulli_s Worker-3 13:05:03,450 F: (ErlRuntime.java:102) : # ping...R15_af3dc_Administrator_96386e@Paulli_s Worker-3 13:05:03,454 F: (ErlRuntime.java:116) : Node R15_af3dc_Administrator_96386e@Paulli_s is up 13:05:03,454 F: (ErlRuntime.java:102) : # ping...R15_af3dc_Administrator_96386e@Paulli_s Worker-3 13:05:03,459 F: (Backend.java:241) : R15_af3dc_Administrator_96386e@Paulli_s: waiting connection to peer... 13:05:03,764 F: (Backend.java:401) : code server started 13:05:03,764 F: (Backend.java:247) : connected! 13:05:03,776 F: (CodeManager.java:223) : adding F:/program/code_edit/eclipse-erlang/plugins/org.erlide.test_support_0.15.3.201204301337/ebin to code path for @8698105:: Backend<erl5.9/R15_af3dc_Administrator_96386e (c:\program files\erl5.9) R15B []> 13:05:03,782 F: (CodeManager.java:223) : adding F:/program/code_edit/eclipse-erlang/plugins/org.erlide.tracing.erlang_0.2.6.201204301337/ebin to code path for @8698105:: Backend<erl5.9/R15_af3dc_Administrator_96386e (c:\program files\erl5.9) R15B []> 13:05:03,788 F: (CodeManager.java:223) : adding F:/program/code_edit/eclipse-erlang/plugins/org.erlide.kernel.common_0.15.1.201204301337/ebin to code path for @8698105:: Backend<erl5.9/R15_af3dc_Administrator_96386e (c:\program files\erl5.9) R15B []> 13:05:03,793 F: (CodeManager.java:223) : adding F:/program/code_edit/eclipse-erlang/plugins/org.erlide.kernel.builder_0.15.0.201204301337/ebin to code path for @8698105:: Backend<erl5.9/R15_af3dc_Administrator_96386e (c:\program files\erl5.9) R15B []> 13:05:03,798 F: (CodeManager.java:223) : adding F:/program/code_edit/eclipse-erlang/plugins/org.erlide.kernel.debugger_0.15.0.201204301337/ebin to code path for @8698105:: Backend<erl5.9/R15_af3dc_Administrator_96386e (c:\program files\erl5.9) R15B []> 13:05:03,802 F: (CodeManager.java:223) : adding F:/program/code_edit/eclipse-erlang/plugins/org.erlide.cover.erlang_0.2.2.201204301337/ebin to code path for @8698105:: Backend<erl5.9/R15_af3dc_Administrator_96386e (c:\program files\erl5.9) R15B []> 13:05:03,807 F: (CodeManager.java:223) : adding F:/program/code_edit/eclipse-erlang/plugins/org.erlide.wrangler.core_0.9.8.201204301337/wrangler/ebin to code path for @8698105:: Backend<erl5.9/R15_af3dc_Administrator_96386e (c:\program files\erl5.9) R15B []> 13:05:03,812 F: (CodeManager.java:223) : adding F:/program/code_edit/eclipse-erlang/plugins/org.erlide.wrangler.core_0.9.8.201204301337/wrangler/app to code path for @8698105:: Backend<erl5.9/R15_af3dc_Administrator_96386e (c:\program files\erl5.9) R15B []> 13:05:03,816 F: (CodeManager.java:223) : adding F:/program/code_edit/eclipse-erlang/plugins/org.erlide.kernel.ide_0.15.1.201204301337/ebin to code path for @8698105:: Backend<erl5.9/R15_af3dc_Administrator_96386e (c:\program files\erl5.9) R15B []> 13:05:03,820 F: (CodeManager.java:223) : adding F:/program/code_edit/eclipse-erlang/plugins/org.erlide.tracing.ttbe_0.1.4.201204301337/ebin to code path for @8698105:: Backend<erl5.9/R15_af3dc_Administrator_96386e (c:\program files\erl5.9) R15B []>
总结: erlang 5.9.3 坑我了。 是导致eclipse erlang ide 安装不成功的主要原因。 推荐使用erlang 5.9.0 的opt 即[otp_win64_R15B.exe],下载地址erlang.org/download/ http://erlang.org/download/otp_win64_R15B.exe , 64位的 和 32位的分别下载自己的
 类似资料: