Erlang compile error "No command to run specified!"

72 views Asked by At

I built the Erlang development environment with IntelliJ and Rebar.

I have modify template code provided by Erlang plugin.

But it does not compile.

Compile log:

"C: \ Program Files \ erl8.2 \ bin \ rebar" "C: \ Program Files \
No command to run specified!
Usage: rebar [-h] [-c] [-v <verbose>] [-q <quiet>] [-V] [-f]
To see a list of built-in commands, execute rebar -c.
        [-D <defines>] [-j <jobs>] [-C <config>] [-p] [-k]
Type 'rebar help <CMD1> <CMD2>' for help on specific commands.

rebar allows you to abbreviate the command to run:
(commands...)

erlang_app.erl:

-spec(start(StartType :: normal | {takeover, node()} | {failover, node()},
    StartArgs :: term()) ->
  {ok, pid()} |
  {ok, pid(), State :: term()} |
  {error, Reason :: term()}).
start(_StartType, _StartArgs) ->
  case 'erlang_sup:':start_link() of
    {ok, Pid} ->
      io:format("start ok~n"),
      {ok, Pid};
    Error ->
      Error
  end.

erlang_sub.erl

For now, there is no generic server to generate, so I also commented out the AChild part and the AChlid part of the function return.

%%  AChild = {'AName', {'AModule', start_link, []},
%%    Restart, Shutdown, Type, ['AModule']},

  {ok, {SupFlags, [AChild]}}.

start.bat

werl -pa ./ebin -eval "application:start(erlang)"
1

There are 1 answers

0
Pascal On BEST ANSWER

The log you are showing says that you have run the command rebar without parameter. To compile your project you should use rebar compile command.