How to set $PATH for IntelliJ (on mac)? - intellij-idea

How to change the $PATH that IntelliJ sees on Mac? I believe it is possible but do not remember how. Thank you!
(I use the LSP Support plugin that invokes executables (specified with an absolute path) that, in turn, try to invoke other commands expecting to find them on the $PATH and failing because /user/local/bin is not on the default path.)

Related

How to update JAVA_HOME for the entire system, not just my terminal?

When I swap my JAVA_HOME to point to another env and close terminal and open it back up, I can echo it and it shows the right path.
However some other applications (name IntelliJ IDEA) will hold the first JAVA_HOME until I log my user out. Simply quitting IntelliJ IDEA like terminal doesn't work.
Why is this? I'm curious where does someone like IntelliJ actually get my JAVA_HOME in case I have one set in my bash_profile and my config_fish for instance. How does intellij (and other programs) know where to look?
Not Sure about IntelliJ but in eclipse, you can set your environment in Window > preference > java > Installed JRE and add your path their
Okay, so there are such things as system env variables but in this case intellij wasn't pulling these from my system. Intellij instead knows how to look for your bash_profile among other configs (also zsh config and fish config)
See the source here: https://github.com/JetBrains/intellij-community/blob/master/plugins/terminal/resources/jediterm-bash.in

How do I run a EXE Go executable from within IntelliJ IDEA?

I have a Go program which I'm working on in IntelliJ IDEA on a Windows machine. The program's structure is a little unconventional (don't want to go into detail here as its besides the point) because of which I first have to compile the program using the following command:
go build -o cli.exe
And then I can run cli.exe directly in the command prompt.
But how do I configure the run configuration in IntelliJ IDEA so that it doesn't mind running a Windows executable ? Because if I try to tell it to run an EXE file as it's run configuration, it gives me error "Main file is invalid"
How do I solve this ?
Make sure you have a file name (not a folder name) in field File on Run/Debug Configuration window (In IntelliJ IDEA go to menu Run->Edit Configuration...->your_configuration). That was my case.
You may be able to install the Bash plugin on Windows, then create a run configuration using the Bash plugin, and just run your executable from a script.
Create a Go Application run configuration and that should work. You can choose to run either a file or a package. If you would share more details then the answer would be more complete. If you still have an issue with this, please open an issue to the bug tracker and I'll be able to help out (please follow the issue template there).

Setting OCaml Binaries Directory Path for OcalDE

I would like to use the OcalIDE plugin to have Ocaml in my Eclipse.
I had installed the ocaml-3.12.0-intel on my Mac and then OcalIDE plugin. But I couldn't make it finish as my Ocaml paths are all undefined.
I know my Ocaml package was installed at /usr/local/lib/ocaml as default, but the preference keep popping value must be an existing file error and I have no idea what was going wrong.
Any help from the floor?
If you installed OCaml in the standard locations, the path should be filled automatically. You can check in:
Window > Preferences > OcaIDE > Paths
Check also this really good tutorial : http://www.algo-prog.info/ocaide/tutorials/1-installing/installing.htm

Making my program compile on both windows and linux, what should I do about libraries?

I'm using CMake to generate my makefiles and VC solutions. I have my program running on linux just fine. I'm using a bunch of libraries, e.g. Lua. On my linux computer I just link to them and make sure in include the headers. All of the .so files are in some standard place. On Windows though I'm not sure what to do. Should I just include the entire Lua project into my own repository and link to that instead? Do I install Lua to some standard place like c:\program files\lua5.1 and link to that? Something else?
Your libraries can be in any place, you just need to say - where are they.
Before running cmake set up pathes of all your extern libs with some .bat file:
set LIBRARYPATH =path\to\your\library\
set include=%include%;%LIBRARYPATH%\include
set lib=%lib%;%LIBRARYPATH%\lib
Start cmd, run this .bat and then cmake should find all
I would provide a configuration field/variable for ccmake that the user can or must specify.
The mark_as_advanced can be used to make a custom variable only appear in the advanced mode. This would be suitable if you have a standard path (as you have mostly on windows). Yet, it still let's the user specify the value if needed.
Or you can simply set a variable the with the 'set' command if you don't want it in advanced.
Just make sure you check if the users entered a valid value.

What is the correct way to customize the install output directory for each developer in CMake?

I've been working on an old game that I created CMake files for to get rid of a mix of Makefiles and visual studio projects. Everything is working well, but I'm having a hard time figuring out what the correct way to allow the developer to specify where the output files are copied to when install is run.
The issue is there are many DLLs and some custom targets that need their output copied into a directory structure that includes the game data (levels, art, sound, etc) before they can test the code.
My install commands currently uses a variable that I 'SET' at the top level CMakeLists.txt to specify the output directory. I've tried overriding it with -DD3_GAMEDIR on the cmake command line. That variable gets set in the CMakeCache, but the SET command appears to override it still.
Should I be checking the length of the variable before using SET to see if the user specified a value? That seems like a hack to me, but I'm having a hard time finding the correct way to do it.
Thanks!
The install target supports the DESTDIR parameter, so you could do something like:
make install DESTDIR="C:\RootGameDir"
The other option is to only set the variable if it isn't already set (if(myVar)), but I personally prefer the DESTDIR solution.
Here is the anwser, according your cmake version:
SET(CMAKE_VERSION "${CMAKE_CACHE_MAJOR_VERSION}.${CMAKE_CACHE_MINOR_VERSION}")
IF("${CMAKE_VERSION}" STRGREATER "2.4")
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY /path/of/your/install/${CMAKE_BUILD_TYPE}/bin)
SET(CMAKE_LIBRARY_OUTPUT_PATH /path/of/your/install/${CMAKE_BUILD_TYPE}/lib)
ELSE("${CMAKE_VERSION}" STRGREATER "2.4")
SET(EXECUTABLE_OUTPUT_PATH /path/of/your/install/${CMAKE_BUILD_TYPE}/bin)
SET(LIBRARY_OUTPUT_PATH /path/of/your/install/${CMAKE_BUILD_TYPE}/lib)
ENDIF("${CMAKE_VERSION}" STRGREATER "2.4")
What about using the various CMAKE_INSTALL_PREFIX, PROJECT_SOURCE_DIR and PROJECT_BINARY_DIR?