could not find java - Windows Server - logstash

I installed Java SRE and JDK. I rebooted the server. I am still getting the "could not find java; set JAVA_HOME or ensure java is in PATH" error. What else should I look for to solve this? Thanks
Here's my PS output. I shortened the Path to just show anything related to Java.
PS C:\Windows\system32> cd C:\ElkStack\logstash-5.6.2
PS C:\ElkStack\logstash-5.6.2> .\bin\logstash.bat
could not find java; set JAVA_HOME or ensure java is in PATH
PS C:\ElkStack\logstash-5.6.2> $ENV:Path
C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\
Program Files (x86)\Java\jre1.8.0_361\bin
PS C:\ElkStack\logstash-5.6.2> $ENV:JAVA_HOME
C:\Program Files (x86)\Java\jre1.8.0_361
My C:\Program Files\Common Files\Oracle\Java\javapath shortcut shows java.exe correctly.
I tried changing the JAVA_HOME to c:\progra~1\Common~1\Oracle\Java\javapath and restarting my PS instance with the same results.

Related

Problem with using node.js on VSC with Windows

My laptop is 64-bit operating system, Windows 10
I have installed Node.js for Windows (version v12.17.0)
I have installed code.runner on VSC as well
However, the error msg
"Command 'node' not found, but can be installed with:
sudo apt install nodejs"
keep appearing. I have no idea what is wrong.
Will changing the user settings or workspace settings help ?
The problem is that you have not set the Path in the Environment Variables.
In Windows, search for "Environment Variables".
Open Environment Variables.Open Path and add the PATH : C:\Program Files\nodejs\bin
By default, the installer uses the Node.js distribution in C:\Program Files\nodejs. If node is installed in C:\Program Files\nodejs directory, then add the PATH in in window's PATH environment variable as C:\Program Files\nodejs\bin.
Restart any open command prompts for the change to take effect.

MongoDB installed successfully on window But folder is not seeing

Hello I am new in mean Technology and I want to installed mongoDb and I downloaded msi setup from link for bit window.
I installed successfully but during installation location of folder not asked and now i don't have idea for the location of mongoDB folder. how to find the mongoDB folder.
It will be installed in Primary Drive. If C drive is primary then Either Directly C:\MongoDB or C:\Program Files\MongoDB
MongoDB available either two folder C:\Program Files or C:\Program Files (x86)
Path would be like -> C:\Program Files\MongoDB\Server\3.4\bin
after that you can setup the path using following inputs:
Create directory like -> C:\mongo\data\db
open cmd prompt - > C:\Program Files\MongoDB\Server\3.4\bin
set the path use below command :
mongod --dbpath=C:/mongo/data/db
uninstalling and installing again worked me to find MongoDb folder in program files.
I have installed MongoDB 1.4 Stable Community Edition. It is installed at AppData folder which is in my Users directory(c:\Users\MyUser\AppData). Check that folder on your system.

JAVA_HOME issue with Grails

I just installed Grails through sdkman, ie: sdk install grails
Evrything seems to have worked fine,
But when I type grails -version this error comes out:
ERROR: JAVA_HOME is set to an invalid directory: /usr/lib/jvm/java-1.7.0- openjdk-i386
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
I'm on linux mint Raffaela
I know this should be an error of JAVA_HOME pointing to the wrong place, but I can't figure out why, this set up works just fine with my Android Studio for example...
Any ideas?
Thanks in advance!
Check your path to java:
echo $JAVA_HOME
Looks like there are wrong path in gradle settings

rm command in Visual Studio 2012 Command Prompt

I have two machines the first one is
Machine A : Windows 7 professional with service pack 1 and VS2012
Machine B : Windows 8.1 and VS2012
Now Machine A gives the following result
E:\>rm
rm: too few arguments
Try `rm --help' for more information.
Whereas Machine B gives the following
C:\>rm
'rm' is not recognized as an internal or external command,
operable program or batch file.
How do I make the rm command work in Windows 8 VS2012 Command Prompt. Is their an add-on I need to install ?
Install GnuWin32 CoreUtils found at http://gnuwin32.sourceforge.net/packages/coreutils.htm. Then add C:\Program Files (x86)\GnuWin32\bin to your PATH.

Error starting Eclipse in Linux: "JVM terminated. Exit code=13"

I am trying to run eclipse and encounter the errors. I am using Kubuntu as my OS and when I typed java -version in terminal I got 'java version "1.6.0_23"'. I have openJDK installed but I am not sure what can I do next. Any thoughts? Thanks.
ERROR:
JVM terminated. Exit code=13
/usr/bin/java
-Dosgi.requiredJavaVersion=1.5
-XX:MaxPermSize=256m
-Xms40m
-Xmx384m
-jar /home/lucky/Downloads/eclipse//plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
-os linux
-ws gtk
-arch x86
-showsplash
- launcher /home/lucky/Downloads/eclipse/eclipse
-name Eclipse
--launcher.library /home/lucky/Downloads/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.2.R36x_v20101019_1345/eclipse_1310.so
-startup /home/lucky/Downloads/eclipse//plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
-exitdata 5cf8058
-product org.eclipse.epp.package.php.product
-vm /usr/bin/java
-vmargs
-Dosgi.requiredJavaVersion=1.5
-XX:MaxPermSize=256m
-Xms40m
-Xmx384m
-jar /home/lucky/Downloads/eclipse//plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
My eclipse.ini
-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.2.R36x_v20101019_1345
-product
org.eclipse.epp.package.php.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-XX:MaxPermSize=256m
-Xms40m
-Xmx384m
Looking at the paths in the error it seems that you are not using eclipse from the ubuntu repositories (that's fine imo).
Check if the jvm is 64 or 32 bit. java -version will tell you. If you find this is a 64-bit jvm then go back to eclipse.org and download a eclipse version for 64-bit. You have eclipse for a 32-bit jvm. See your error message where it says -arch x86
Try to start eclipse from a shell using the -vm parameter. On ubuntu you can find the installed jre/jdk's under /var/lib/jvm/. E.g.:
./eclipse -vm /var/lib/jvm/sun-java6-jdk/bin
You could add this parameter to your eclipse.ini file.
Helps?
This could be of interest as well: Eclipse starting error of JVM terminated. Exit code=13 after upgrading Ubuntu updates
I have found solution for errors 13 and 1 in following video:
Eclipse Error 13 and Error 1
Both errors are fixed by editing eclipse.ini in eclipse directory.
Error 13 is fixed by adding complete path to javaw. In my case it is:
-vm
c:\Program Files\Java\jdk1.8.0_45\bin\javaw.exe
Error 1 is caused by setting arguments for virtual machine before setting vm. itself.
This means two lines we just added must be before the
-vmargs
line.
Done.
Specify the JVM you want to use in your eclipse.ini file, as described in http://wiki.eclipse.org/Eclipse.ini
I'd recommend using the JDK from Oracle; I'm not sure the current state of compatibility between Eclipse and OpenJDK.
This might sound a little odd but I have stumbled upon the same problem (StS 3.2.2 on Juno 4.2.2 with Java 7 u25 both 64 bit on win7) and nothing seemed to work, then I moved my sts out of the directory I originally installed it (d:#sts\springsource\sts-3.2.0.RELEASE) to (d:\springsource\sts-3.2.0.RELEASE), and now it works.
I kept it in both places and if I want to start it from its original location it promptly crashes with exit code 13, if I start it from the new place it works just fine.
So it might be that eclipse does not like hash marks, or it was "too far away" from root and some of the files paths-es went beyond 256 char. (Nonetheless its quite odd the get exit code 13 since in my case it had nothing to do with non-matching versions)
I had the same error.
I got through with the following:
which java
It gave me :/usr/local/java/jre1.7.0_25/bin/java
I went to the folder where eclipse was located (~/Developer/adt-bundle-linux-x86_64-20140624/eclipse/ in my case )
cd ~/Developer/adt-bundle-linux-x86_64-20140624/eclipse/
Then
./eclipse -vm /usr/local/java/jre1.7.0_25/bin
You can make this permanent by editing the eclipse.ini file:
Right after OpenFile I inserted 2 lines containing:
-vm
/usr/local/java/jre1.7.0_25/bin/java
The second line being the output from the which java command.
Now Eclipse loads for me but it misbehaves, hopefully not related.
I had this issue on my windows 8.1 machine. All the suggestions didn't fix my issue.
I then thought about the root cause. I believed it was caused by degrading from JDK-9 to JDK-8. I recently uninstalled JDK-9.
I went and checked the Environment Variable-->Path and it contained another Java reference of "C:\ProgramData\Oracle\Java\javapath".
I simply removed this extra "C:\ProgramData\Oracle\Java\javapath" from Path(environment variable), and My Eclipse worked.
I hope this helps others.

Resources