"bash: jstack: command not found" error on Amazon Linux AMI - java

On ec2 instance(Amazon Linux AMI) jstack is giving following error
bash: jstack: command not found
Java is installed on the machine
java -version
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
Is there any reason to get error for jstack when java is already installed?

JDK is required for jstack. The instance only has JRE.

Related

Issue with Eclipse with Scala IDI

Once i integrate scala IDI in eclipse(by using eclipse marketplace) and restart it, i get the below error message.
Alert: Failed to create a java virtual machine.
java -version
java version "1.8.0_341"
Java(TM) SE Runtime Environment (build 1.8.0_341-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.341-b10, mixed mode)

After downloading a java file it would not open

Note: This is on mac
So i downloaded a java file recently and after downloading it i tried opening it to which it says the java jar file cannot be opened and to check to console. After looking up a tutorial i put the following commands into the terminal.
Umairs-MacBook-Air:~ umairahmed$ java -version
java version "11.0.2" 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)
Umairs-MacBook-Air:~ umairahmed$ java -jar/Users/umairahmed/Downloads/forge-1.12.2-14.23.5.2768-universal.jar
Unrecognized option: -jar/Users/umairahmed/Downloads/forge-1.12.2-14.23.5.2768-universal.jar
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
How do i fix this?
You are missing a space
java -jar /Users/.......

java 11, running sdkmanage results in java.lang.module.FindException: Module java.se.ee not found

i tried
export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
and some old solutions here for java 9 same error but nothing work. please help
OS: mac. java version:
Users-MacBook-Pro:Users user$ java --version
java 11.0.2 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)
open sdkManager:
Users-MacBook-Pro:~ user$ /Users/user/android/tools/bin/sdkmanager ; exit;
Error occurred during initialization of boot layer
java.lang.module.FindException: Module java.se.ee not found
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
[Process completed]
EDIT - MORE DATA:
I installed java 8 as well and run this command:
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`; java -version
and got:
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
But sdkmanage still gives the same error.
By the way, when close an open again the terminal, running java -version results again with:
java version "11.0.2" 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)
Is it OK?
UPDATE 1.4
I have change the .bash_profile file to this:
export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_202`
unset JAVA_OPTS
and running env give:
Users-MacBook-Pro:~ user$ env
TERM_PROGRAM=Apple_Terminal
SHELL=/bin/bash
TERM=xterm-256color
TMPDIR=/var/folders/9t/4jx8w7_s6f5blrh1yly746z80000gn/T/
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.gDNTyh8LPx/Render
TERM_PROGRAM_VERSION=404.1
TERM_SESSION_ID=8F5607E3-18FE-467B-B843-58F71D03F9B0
USER=user
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.jY4TgxEWu3/Listeners
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
PWD=/Users/user
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
SHLVL=1
HOME=/Users/user
LOGNAME=user
LC_CTYPE=UTF-8
_=/usr/bin/env
Users-MacBook-Pro:~ user$
running sdk manager still give the same error
I had the same problem and I did this:
export APP_HOME=/path/to/my/java-8
export JAVA_HOME=/path/to/my/java-8
On the other hand, if you want to keep this configuration on reboot or in other terminal, you must put these lines on ~/.bashrc file

VsCode does not indicate the correct version

Why not specified correct version of java JRE in my vscode ?
Here is my java version.
$java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
And env path here,
$env | grep JAVA
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home
And user setting in vscode,
"java.home": "/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home",
When open java project in vscode, next error occurred.
enter image description here
Hello.Thank you.

JNLP application fails with error about missing jniwrap64.dll

I have a JNLP application which fails with the following error:
Cannot find JNIWrapper native library (jniwrap64.dll) in java.library.path: ....
I have Java 8 64bit installed and using IE11.
Any help on how to fix it will be appreciated.
Just to clarify: I did not write the application and only trying to run it.
You need 32bit java version to launch the JNLP application and not 64bit java
please run below command to check what version of java you are running
C:\RIM\SINGTEL\950_0\inproc>java -d64 -version
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

Categories

Resources