Elasticsearch can't start on Windows Git Bash - elasticsearch

I am trying to start Elasticsearch using the command bin/elasticsearch but I'm getting an error that says Could not find or load main class org.elasticsearch.bootstrap.Elasticsearch as shown below.
me#DESKTOP-T11JTA5 MINGW64 ~/elasticsearch-1.3.4
$ pwd
/c/Users/jacky/elasticsearch-1.3.4
me#DESKTOP-T11JTA5 MINGW64 ~/elasticsearch-1.3.4
$ ls
bin/ config/ lib/ LICENSE.txt NOTICE.txt README.textile
me#DESKTOP-T11JTA5 MINGW64 ~/elasticsearch-1.3.4
$ bin/elasticsearch
Error: Could not find or load main class org.elasticsearch.bootstrap.Elasticsearch

Probably your JAVA_HOME is not pointing at your JRE 1.7 directory.
Try something like:
set JAVA_HOME=C:\Program Files\Java\jre7
Of course, changing the path to your real Java instalation path. If you don't, install Oracle's Java 1.7

Related

How to properly install GO with paths and all?

I have installed GO, setup the paths but when i run a file i get this error:
error!! exec: "sqlboiler": executable file not found in $PATH
exec: "sqlboiler": executable file not found in $PATH
exec: "sqlboiler": executable file not found in $PATH
exit status 3
What is going wrong?
The installation instructions are good, https://go.dev/doc/install. However, for me un Ubuntu 20.4 in wsl2, the suggested path for the binaries wasn't enough. Only go and gofmt are added to /usr/local/go/bin.
I did add the below to my .bashrc, since go install puts the binaries in this location on my system.
export PATH="$HOME/go/bin:$PATH"
Note, that the path to the binaries may differ on your system, so you have to adjust it accordingly.
Any binary you install with go install that is added to this path will be available to your shell afterwards.
For example:
$ go install github.com/volatiletech/sqlboiler/v4#latest
$ go install github.com/volatiletech/sqlboiler/v4/drivers/sqlboiler-psql#latest
$ whereis sqlboiler
sqlboiler: /home/blue/go/bin/sqlboiler
Potentially, you also need some database packages to your system. I am not sure on this any more. For example, you could add some Postgres libs if you are using Postgres. You have to see if it works without.
apt-get install postgresql-client-common postgresql-client-12
How to properly install GO with paths and all?
Install Go with the installer (Windows) or archive (extract into /usr/local on Linux/Mac).
When installing from archive, manually add the directory path where the go binary is located (/usr/local/go) to PATH.
Set GOPATH to a directory path wherein to contain bin, pkg and src sub-directories.
Add ${GOPATH}/bin to PATH.
What is going wrong?
The program you are running is trying to run the executable sqlboiler, which cannot be found in any of the directories specified in PATH.

Using `go` with fish shell

I am struggling with running go in the fish shell.
A) I followed the installation procedure and installed go as specified in the documentation
However, when I run go version, I am getting a fatal error:
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
When I initialize the git by git init, I receive another error:
error: pathspec 'version' did not match any file(s) known to git
I have the paths configured in my fish config as follows:
set -gx GOPATH /home/<user>/go
set -gx PATH $PATH /usr/local/bin/go $GOPATH/bin
where /usr/local/bin/go is an output of which go in both bash and fish
Running it like bash -c 'go version', however, works without any problems (even without the git directory).
B) Also tried gofish and dnf to install go, the same results
Any help is greatly appreciated!
Additional info:
Fish version: fish, version 3.0.2
Operating system: Linux t460s 5.0.13-300.fc30.x86_64 x86_64 GNU/Linux
Could this be some kind of alias that is used instead? The error message is an error from the git binary.
Take a look in your file ~/.config/fish/config.fish and see if you find an alias there. If you do not find anything there look at the files in ~/.config/fish/ and subfolders.

'yarn offline' use absolute path when setting 'yarn-offline-mirror' path

I am trying to create yarn offline mirror. I followed the steps mentioned
here
When setting offline-mirror-dir as in the link above:
"$ yarn config set yarn-offline-mirror ./npm-packages-offline-cache"
where ./npm-packages-offline-cache is an example location relative to home folder where all the source .tar.gz files will be downloaded to from the registry.
I need to set an absolute path instead of relative path? How can I do that?
$ yarn --version
1.2.1
For an absolute path simply specify the full path. ( Which would start with root / instead of the dot . ) Example:
$ yarn config set yarn-offline-mirror /tmp/npm-packages-offline-cache
$ yarn install
$ ls /tmp/npm-packages-offline-cache
A path relative to where yarn is executed instead of home can be specified as follows:
$ yarn config set yarn-offline-mirror vendor/npm-packages-offline-cache
$ cd ~/my_project
$ yarn install
$ ls ~/my_project/vendor/npm-packages-offline-cache

why this JRE error happening during maven build

Even though I set the JAVA_HOME and PATH to point to the JDK7 directory, Maven takes the /usr/bin/ as JVM path and It searches for the tools.jar file in the JRE and throws the below error.
Fatal error compiling
Embedded error: tools.jar not found: /usr/lib/jvm/java-7-openjdk-amd64/jre/../lib/tools.jar
But if i set the /usr/bin/java to point to the JDK directory manually, it works fine. I am puzzled with this behavior. Can someone explain why it is like that ?
Close terminal and reopen it and check whether $PATH is Proper.
echo $JAVA_HOME -or-
echo $PATH
Assuming that you have a linux machine.
Take a look on /usr/bin/java, this is a symbolic link. Look where is a target of this symbolic link (in my case the target is at this location /etc/alternatives/java)
/etc/alternatives/java is symbolic link too. Create new symbolic link to "proper" JVM (e.g. Sun's JVM)
Replace /etc/alternatives/java with newly created symbolic link by /usr/sbin/alternatives --install /usr/bin/java java /usr/java/latest/bin/java 2

Cygwin failing to find Java

I'm currently trying to configure a standalone Hadoop node on a new computer (for my own learning purposes) but when I try to find the root of my java installation using $which java
as per this question
root of java installation
I get the following error
Me#myhouse /cygdrive/c/Program Files (x86)
$ which java
which: no java in (/usr/local/bin:/usr/bin:/cygdrive/c/Windows/system32:/cygdrive
/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32
/WindowsPowerShell/v1.0:/cygdrive/c/Program Files (x86)/ATI Technologies/ATI.ACE/Core-Static)
I get the exact same error message at the top level of my C: drive.
I know that Java is there - I just installed it! Can anyone explain what I have done wrong?
Your command just checks if java is found in the common paths from cygwin
So in cygwin you need to add the java path to the paths: export JAVA_HOME="/cygdrive/c/Program\ Files/Java/jre1.8.0_102" export PATH="$PATH:$JAVA_HOME/bin"

Resources