IntelliJ throws "init terminating in do_boot", but same erl command works in Windows command line - intellij-idea

Setup: IntelliJ IDEA 2022.2.2, Erlang 25.0
I am trying to run the Erlang code available at https://erlangbyexample.org/send-receive. I am able to run in werl and Windows command line. But I am getting the error "init terminating in do_boot" when I run in IntelliJ.
I checked a similar issue reported in this question , wherein the solution was to convert list input to integer/s. However, my Erlang code does not expect any input, it just expects the function name.
Please provide a pointer to resolve the issue.
"C:\Program Files\Erlang OTP\bin\erl.exe" -pa F:/1TB/P/workspace-IntelliJ-Erlang1/out/production/workspace-IntelliJ-Erlang1 -pa F:/1TB/P/workspace-IntelliJ-Erlang1 -eval send_recv:run(). -s init stop -noshell
{"init terminating in do_boot",{undef,[{send_recv,run,[],[]},{erl_eval,do_apply,7,[{file,"erl_eval.erl"},{line,744}]},{init,start_it,1,[{file,"init.erl"},{line,1234}]},{init,start_em,1,[{file,"init.erl"},{line,1220}]},{init,do_boot,3,[{file,"init.erl"},{line,910}]}]}}
init terminating in do_boot ({undef,[{send_recv,run,[],[]},{erl_eval,do_apply,7,[{_},{_}]},{init,start_it,1,[{_},{_}]},{init,start_em,1,[{_},{_}]},{init,do_boot,3,[{_},{_}]}]})
Crash dump is being written to: erl_crash.dump...done

I configured RunConfiguration to BUILD before RUNNING ("Before launch" section). As result, RunConfiguration was creating an empty folder "../out/production/workspace-IntelliJ-Erlang1" without .beam files, if the folder does not exist. It would delete any existing .beam files if the folder exists. Hence, the RUN was failing eventually.
As a workaround, I removed the BUILD before RUNNING option from RunConfiguration. And, I manually built using BuildProject before RunConfiguration.
TODO: I will check why was not RunConfiguration able to generate the .beam file.

Check if there is a file called send_recv.beam in either of the directories specified as code path in the -pa arguments. (The undef error means that it can't find the function send_recv:run/0, more often than not because it can't find the compiled module.)
My guess is that this file is actually in the directory where you ran Erlang from the command prompt, but IntelliJ runs Erlang using another working directory. The current working directory is part of the code path by default, which would be why this works from the command prompt but not within IntelliJ.

Related

Payara does not start from Intellij

The Payara with GlassFish 5.192.0 does not start using the Intellij Idea.
If I run payara\bin\asadmin start-domain is works just fine, and the server starts and runs.
These are the final lines from the console output with the --verbose property set on true.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Unrecognized option: --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED
Command start-domain failed.
The DAS was stopped.
The root case of the issue is logged here.
Windows launcher prepends PATH with JetBrains Runtime bin directory in order to load certain DLLs without issues. It turned out to be not the best solution and we are working to address it in a different way.
asadmin.bat uses the first java.exe from PATH. It doesn't try to detect it via JAVA_HOME.
The workaround for now is to switch IntelliJ IDEA boot JDK to JBR8 per this document or start IntelliJ IDEA using idea.bat instead of idea64.exe.
The issue is fixed in 2019.2.1 RC.

/sbin/nologin issue with msys2 on Windows 10

I have just installed MSys2 (https://msys2.github.io, msys2-x86_64-20150916.exe) on my Windows 10 computer.
Once installed, the terminal is launched. But as soon as I stop it and relaunch it, I get the error: "Failed to run /sbin/nologin: No such file or directory".
Any idea on what to do?
You should figure out why Bash is trying to run /sbin/nologin. Check your Windows home directory (e.g. C:\Users\Joe) for files like .bash_profile, .profile, and .bashrc. Inspect those files and find which one is calling nologin.
If that doesn't help, try creating an empty file in C:/msys64/sbin/nologin, or wherever you actually installed MSYS2. An empty file would be a valid shell script and run without errors.
If the error is non-fatal you might consider just ignoring it.

Cannot auto configure pydev in eclipse

I have installed PyDev successfully, I have python 3.4.0 installed successfully and the folder containing python.exe is in my path and I can run it from the command line.
However, when I go to window\preferences\pydev\interpreters\python interpreter and select 'quick auto-config' to configure it using normal python I get an error saying 'auto configurator could not find a valid interpreter... Note the system environment variables used for Jython are PATH and PYTHONHOME.'
Unless this is a bug in the text I am not selecting Jython (I get a different error if I select IronPython, btw, so this is not a generic error message).
The trace is as follows:
Errors getting info on discovered interpreter(s).
See error log for details.
java.lang.RuntimeException: java.io.IOException: Cannot run program "python": CreateProcess error=2, The system cannot find the file specified
As I say, python.exe is in my path.
You have to install the actual python package separately from here https://www.python.org/download
Close LiClipse/Eclipse => Download Python Here: https://www.python.org/download
=> reopen LiClipse => Auto Config for the interpreter Will WORK!
I found the answer, but I'll leave this up in case anyone else gets it. It's a pretty stupid auto config option if you ask me ;)
In the higher level window\preferences\pydev\interpreters\ preference you need to untick jython and ironpython.
No idea why given I selected the Python sub-preference specifically.

I am trying to open Jmeter by the batch file but it gives me a Windows error

Here is the related error its showing:
java.exe is not a recognized file as an internal or external command,
operable or external command
errorlevel=9009
i was getting the same error on WIndows 8.1(64 bit) and checked java path but it was ok
so i just run my jmeter.bat with Run as Administrator and it worked for me
Many operating systems have an environment variable such as PATH that contains a list of directories (or folders) to be searched when looking for a command to execute. Commands that can be found via the PATH are commonly called external commands. The program that reads the command line or the batch file and invoked the commands may have a number of built in commands, these are commonly called internal commands.
I suggest you examine the PATH (or equivalent) set when your java command executes from the command line and also when execution is attempted from the batch file. Compare the two and make sure the directory containing your java.exe is in the PATH.
Does not work with Java 9 beta:
Running:
C:\java -version
Gives:
java version "9-ea"
Just go into command line and run:
java -jar ApacheJMeter.jar
Set the correct Java Path (installed in your system) in Computer -> Advanced System settings -> Environment Variables -> Ok -> System Variables -> Path
I got the same issue and resolved by following the above steps.
I tried everything, this eventually worked.
Within System Variables:
PATH = "C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Java\jdk1.8.0_101\bin"
May help someone.
This error occurs due to the path has not been set properly.
Either you can set it in environmental varialables or right click jmeter .bat file,choose edit set the path their,for reference see the jmeter.apache.org user manuals.
For me, my Java path has a space in it and jmeter said it can't find Java
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
.. I looked at the jmeter.sh script and saw it got the path from "Plugin-Ins" .. onward. I tried just commenting out the exit command after that check in the script .. and then I was able to run jmeter.
So apparently the validation logic has a bug, where the error message about can't find java is in fact not true (if Java is indeed set up correctly), so it can be ignored.
For windows 8.1 Users:
Error when trying to run jmeter.bat
Error message:
Not able to find Java executable or version. Please check your Java installation. errorlevel=2
Press any Key to continue
Resolution:
Right Click jmeter.bat and Run as Administrator.
This worked for me, hope this helps. Good luck
Set the correct JM_LAUNCH variable to java.exe
For Windows XP users set Java environment by following the steps here:
http://www.tutorialspoint.com/jmeter/jmeter_environment.htm
Note the path depends on your installed JDK.
And download the file from:
https://svn.apache.org/repos/asf/jmeter/trunk/bin/jmeter.bat
Then replace your jmeter.bat with the downloaded file.
If you have installed Java and still you get this error, please set the java_home path to below using typing below command in terminal:
export JAVA_HOME="/Library/InternetPlugIns/JavaAppletPlugin.plugin/Contents/Home"
Since I run many versions of Java.. I modified jmeter.bat.
rem JM_START - set this to "start" to launch JMeter in a separate window
rem this is used by the jmeterw.cmd script.
rem
rem =====================================================
setlocal
rem Minimal version to run JMeter
set MINIMAL_VERSION=1.8.0
set PATH=%PATH%;C:\Program Files (x86)\IBM\Java80\jre\bin <<< add This line to jmeter.bat
Copied the JAVA executable from Installed version of Java from C:\Program FilesJava\jdk1.8.0_191\bin and pasted in the folder where the jmeter bat resides and it worked for me.
Not exactly the same issue but somebody might find it helpful
Do not double click jmeter.bat but instead ApacheJMeter.jar in the same directory
For me jmeter.bat run but for a brief moment closing almost immediately and not prompting any error. Above workaround allowed me to start working
if JAVA -version shows as blank or empty in the command prompt (CMD) then you need to clear the all java paths in environment variable and again add JAVA_HOME=C:\Program Files\Java\jdk-11.0.15.1
path= C:\Program Files\Java\jdk-11.0.15.1\bin;
if you see C:\Program Files\Common Files\Oracle\Java\javapath; like this remove this
and try in new CMD prompt then Java -version will work.

Get Error while building libav on windows using minGW and MSYS

I have a trouble with libav.
I used MinGW and MSYS to build libav on windows. However, When I use "make", after some file(.o file) were build i get error,
It is
$ make
AR libavcodec/libavcodec.a C:\msys\mingw\bin\ar.exe: libavcodec/: Permission denied
make: *** [libavcodec/libavcodec.a] Error 1
After that, I view the permission of libavcodec folder, I have all permission. :|
Please help me solve this trouble or give me a full instruction to build libav on windows (I use win7 x64 and have msys, mingw)
Thanks!!!
I'm not sure if this is relevant, but I had the same error when trying to make ffmpeg. Initially I was getting a missing separator error (in one of the makefiles) when I used configure. I found a page that suggested checking that git was using unix line endings rather than windows (CR LF). So I used
git config --global core.autocrlf false
to set git to use unix line endings and then thought I'd updated my source (being new to git, it turned out I hadn't). I still got the missing separator error, so I added a tab to the start of the line and configure completed. I then used make and would get the same error you're getting. I saw in some of the other makefiles that they still had windows line endings, so I deleted the entire directory apart from the .git folder as mentioned here, and then used
git reset --hard
to get the files again. After this configure and make worked without error, so my guess would be that you're using windows line endings or there's something wrong with the makefiles.