I've read a similar issue but my environment is different.
I've cloned the Corda samples and ensured that I have Java 8 (update 301) and Gradle 5.6.4:
cordapp-example % java -version
java version "1.8.0_301"
Java(TM) SE Runtime Environment (build 1.8.0_301-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.301-b09, mixed mode)
cordapp-example % gradle -version
------------------------------------------------------------
Gradle 5.6.4
------------------------------------------------------------
Build time: 2019-11-01 20:42:00 UTC
Revision: dd870424f9bd8e195d614dc14bb140f43c22da98
Kotlin: 1.3.41
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.14 compiled on March 12 2019
JVM: 1.8.0_301 (Oracle Corporation 25.301-b09)
OS: Mac OS X 10.16 x86_64
Yet when I follow the "Run a sample Cordapp" tutorial I fail at the runnodes step:
cordapp-example % bash -c 'cd "/Users/arinea/Munca/Corda/samples-java/Basic/cordapp-example/build/nodes/PartyB" ; "/Library/Java/JavaVirtualMachines/jdk-11.0.10.jdk/Contents/Home/bin/java" "-Dcapsule.jvm.args=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5007 -javaagent:drivers/jolokia-jvm-1.6.0-agent.jar=port=7007,logHandlerClass=net.corda.node.JolokiaSlf4jAdapter" "-Dname=PartyB" "-jar" "/Users/arinea/Munca/Corda/samples-java/Basic/cordapp-example/build/nodes/PartyB/corda.jar" && exit'
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by Capsule (file:/Users/arinea/Munca/Corda/samples-java/Basic/cordapp-example/build/nodes/PartyB/corda.jar) to field com.sun.jmx.mbeanserver.JmxMBeanServer.mbsInterceptor
WARNING: Please consider reporting this to the maintainers of Capsule
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Listening for transport dt_socket at address: 5007
[quasar] ERROR: java/lang/Object
java.lang.IllegalArgumentException
at co.paralleluniverse.asm.ClassReader.<init>(Unknown Source)
at co.paralleluniverse.asm.ClassReader.<init>(Unknown Source)
at co.paralleluniverse.asm.ClassReader.<init>(Unknown Source)
at co.paralleluniverse.fibers.instrument.MethodDatabase.checkFileAndClose(MethodDatabase.java:345)
at co.paralleluniverse.fibers.instrument.MethodDatabase.checkClass(MethodDatabase.java:325)
at co.paralleluniverse.fibers.instrument.MethodDatabase.getOrLoadClassEntry(MethodDatabase.java:184)
at co.paralleluniverse.fibers.instrument.SimpleSuspendableClassifier.isSuspendable(SimpleSuspendableClassifier.java:156)
at co.paralleluniverse.fibers.instrument.DefaultSuspendableClassifier.isSuspendable(DefaultSuspendableClassifier.java:47)
at co.paralleluniverse.fibers.instrument.CheckInstrumentationVisitor.visitMethod(CheckInstrumentationVisitor.java:130)
at co.paralleluniverse.asm.ClassReader.b(Unknown Source)
at co.paralleluniverse.asm.ClassReader.accept(Unknown Source)
at co.paralleluniverse.asm.ClassReader.accept(Unknown Source)
at co.paralleluniverse.fibers.instrument.MethodDatabase.checkFileAndClose(MethodDatabase.java:348)
at co.paralleluniverse.fibers.instrument.MethodDatabase.checkClass(MethodDatabase.java:325)
at co.paralleluniverse.fibers.instrument.MethodDatabase.getOrLoadClassEntry(MethodDatabase.java:184)
at co.paralleluniverse.fibers.instrument.MethodDatabase.isMethodSuspendable0(MethodDatabase.java:195)
at co.paralleluniverse.fibers.instrument.MethodDatabase.isMethodSuspendable(MethodDatabase.java:162)
at co.paralleluniverse.fibers.instrument.InstrumentMethod.isSuspendableCall(InstrumentMethod.java:231)
at co.paralleluniverse.fibers.instrument.LabelSuspendableCallSitesClassVisitor$1.visitMethodInsn(LabelSuspendableCallSitesClassVisitor.java:64)
at co.paralleluniverse.asm.ClassReader.a(Unknown Source)
at co.paralleluniverse.asm.ClassReader.b(Unknown Source)
at co.paralleluniverse.asm.ClassReader.accept(Unknown Source)
at co.paralleluniverse.asm.ClassReader.accept(Unknown Source)
at co.paralleluniverse.fibers.instrument.QuasarInstrumentor.instrumentClass(QuasarInstrumentor.java:129)
at co.paralleluniverse.fibers.instrument.QuasarInstrumentor.instrumentClass(QuasarInstrumentor.java:100)
at co.paralleluniverse.fibers.instrument.JavaAgent$Transformer.transform(JavaAgent.java:241)
at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:246)
at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:563)
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at java.base/sun.launcher.LauncherHelper.loadMainClass(LauncherHelper.java:760)
at java.base/sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:655)
Upon careful inspection of the first lines in the three tabs that fail we see:
... "/Library/Java/JavaVirtualMachines/jdk-11.0.10.jdk/Contents/Home/bin/java" ...
I do also have this Java 11 installed on my OS X but why is it being picked up!?
java -version, as seen above, points to 1.8 u301,
cordapp-example % echo $JAVA_HOME
/Users/arinea/.jenv/versions/1.8.0.301
cordapp-example % ll /Users/arinea/.jenv/versions
total 0
lrwxr-xr-x 1 arinea staff 64B 24 Iul 22:37 1.8 -> /Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home
lrwxr-xr-x 1 arinea staff 64B 24 Iul 22:37 1.8.0.241 -> /Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home
lrwxr-xr-x 1 arinea staff 64B 13 Aug 16:00 1.8.0.301 -> /Library/Java/JavaVirtualMachines/jdk1.8.0_301.jdk/Contents/Home
lrwxr-xr-x 1 arinea staff 63B 24 Iul 22:37 11 -> /Library/Java/JavaVirtualMachines/jdk-11.0.10.jdk/Contents/Home
lrwxr-xr-x 1 arinea staff 63B 24 Iul 22:37 11.0 -> /Library/Java/JavaVirtualMachines/jdk-11.0.10.jdk/Contents/Home
lrwxr-xr-x 1 arinea staff 63B 24 Iul 22:37 11.0.10 -> /Library/Java/JavaVirtualMachines/jdk-11.0.10.jdk/Contents/Home
lrwxr-xr-x 1 arinea staff 64B 24 Iul 22:37 oracle64-1.8.0.241 -> /Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home
lrwxr-xr-x 1 arinea staff 64B 13 Aug 16:00 oracle64-1.8.0.301 -> /Library/Java/JavaVirtualMachines/jdk1.8.0_301.jdk/Contents/Home
lrwxr-xr-x 1 arinea staff 63B 24 Iul 22:37 oracle64-11.0.10 -> /Library/Java/JavaVirtualMachines/jdk-11.0.10.jdk/Contents/Home
For the life of me I can't tell why is JDK11 picked up.. Do I need to remove it from my system?
Later edit:
This problem happens when I run ./build/nodes/runnodes from the cordapp-example directory. If I go to build/nodes and run there java -jar runnodes.jar everything works well, as expected...
The answer is right in the runnodes script file:
1 #!/usr/bin/env bash
2
3 set -eo pipefail
4
5 # Allow the script to be run from outside the nodes directory.
6 basedir=$( dirname "$0" )
7 cd "$basedir"
8
9 if [ -z "$JAVA_HOME" ] && which osascript >/dev/null; then
10 # use default version of java installed on mac
11 /usr/libexec/java_home --exec java -jar runnodes.jar "$#"
12 else
13 "${JAVA_HOME:+$JAVA_HOME/bin/}java" -jar runnodes.jar "$#"
14 fi
Line 11 gets executed (as opposed to line 13) which uses /usr/libexec/java_home which in my case (and many other people's, judging from what I could find on the net..) will point to the latest JDK installed. That is JDK 11 and Corda is not compatible with it.
Just make sure you don't use that one and use a JDK 8 above update 131.
Related
I have 2 java on my server, where I installed java8 first, then java 11
by default, there is no jre -> /etc/alternatives/jre
[root#server-1:jvm]# ls -all
...
lrwxrwxrwx 1 root root 26 Mar 17 09:10 java -> /etc/alternatives/java_sdk
drwxr-xr-x 9 root root 215 Mar 17 09:10 java-11-amazon-corretto
drwxr-xr-x 3 root root 17 Mar 17 07:17 java-1.8.0-amazon-corretto.x86_64
While after I set the default java with alternative command, the link to /etc/alternatives/jre is created automatically
[root#server-1:jvm]# alternatives --config java
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
+ 1 /usr/lib/jvm/java-1.8.0-amazon-corretto.x86_64/jre/bin/java
* 2 /usr/lib/jvm/java-11-amazon-corretto/bin/java
Enter to keep the current selection[+], or type selection number: 2
[root#server-1:jvm]# ls -all
...
lrwxrwxrwx 1 root root 26 Mar 17 09:10 java -> /etc/alternatives/java_sdk
drwxr-xr-x 9 root root 215 Mar 17 09:10 java-11-amazon-corretto
drwxr-xr-x 3 root root 17 Mar 17 07:17 java-1.8.0-amazon-corretto.x86_64
lrwxrwxrwx 1 root root 21 Mar 17 09:21 jre -> /etc/alternatives/jre <<<<< i want to keep this
But once I switch back to java8, the jre -> /etc/alternatives/jre was removed.
How can I keep the link?
UPDATE: example problem what to be solved
A application have to access the cacert file in java, e.g.
***/usr/lib/jvm/java-1.8.0-amazon-corretto.x86_64/jre***/lib/security/cacerts
***/usr/lib/jvm/java-11-amazon-corretto.x86_64***/lib/security/cacerts
So I would like to have the /usr/lib/jvm/jre or /etc/alternatives/jre pointing to the java home
In case of corretto8
/usr/lib/jvm/jre -> /etc/alternatives/jre -> /usr/lib/jvm/java-1.8.0-amazon-corretto.x86_64/jre
In case of corretto11 (which the 'alternative' already did if I switch to )
/usr/lib/jvm/jre -> /etc/alternatives/jre -> /usr/lib/jvm/java-11-amazon-corretto.x86_64
I have a Maven project in IntelliJ working with the bundled version of Maven however when I come to do a release:prepare release:perform directly from within the IDE I get the following error.
Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project XXXXXX: Maven execution failed, exit code: '126'
Within IntelliJ I am using a project specific JDK (JDK 8) which is different to my machine JDK (JDK 11). I also am using the bundled Maven 3 with IntelliJ 2020.1 but have no Maven installed on my machine outside of the IDE.
I don't use JDK 8 or Maven anywhere other than this one project so would like to not have to install the extra tools globally if I can get away with running then from within this one project in the IDE. Is that possible? I'm building a Jenkins plugin for context if that matters?
Question: What is exit code 126?
Question: In order to perform a release:prepare release:perform do I need to to install the bundled project specific tools on my machine as opposed to keeping them within my project in IntelliJ?
Edit: Running with -x or --debug yields this error:
[INFO] Executing: /bin/sh -c cd /home/XXX/Development/XXXXX-plugin && /home/XXXX/.local/share/JetBrains/Toolbox/apps/IDEA-C/ch-0/201.7223.91/plugins/maven/lib/maven3/bin/mvn -s /tmp/release-settings2724175258197430802.xml clean install --no-plugin-updates -P jenkins
/bin/sh: 1: /home/XXXX/.local/share/JetBrains/Toolbox/apps/IDEA-C/ch-0/201.7223.91/plugins/maven/lib/maven3/bin/mvn: Permission denied
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
It appears to be this bug: https://youtrack.jetbrains.com/issue/IDEA-139236
Which is duplicated by: https://youtrack.jetbrains.com/issue/IDEA-157229 that contains the following workaround:
Using a newly generated plugin project using the
maven-archytype-plugin, when I tried running the default integration
test, it failed due to the following error:
/bin/sh: /Applications/IntelliJ IDEA 14.app/Contents/plugins/maven/lib/maven3/bin/mvn: Permission denied
When checking the /Applications/IntelliJ IDEA
14.app/Contents/plugins/maven/lib/maven3/bin/:
evil-jim-klo:lib2 jklo$ cd "/Applications/IntelliJ IDEA 14.app/Contents/plugins/maven/lib/maven3/bin/"
evil-jim-klo:bin jklo$ ls -l
total 88
-rw-r--r--# 1 jklo admin 183 Dec 21 04:08 m2.conf
-rw-r--r--# 1 jklo admin 5063 Dec 21 04:08 mvn
-rw-r--r--# 1 jklo admin 5985 Dec 21 04:08 mvn.bat
-rw-r--r--# 1 jklo admin 5253 Dec 21 04:08 mvnDebug
-rw-r--r--# 1 jklo admin 6167 Dec 21 04:08 mvnDebug.bat
-rw-r--r--# 1 jklo admin 5539 Dec 21 04:08 mvnyjp
Note none of the files are set to executable. The expectation is that
all maven binaries should be executable by default upon installation
or application update.
I corrected the problem by performing:
chmod a+x *
chmod a-x m2.conf
to produce the following permissions:
evil-jim-klo:bin jklo$ ls -l
total 88
-rw-r--r--# 1 jklo admin 183 Dec 21 04:08 m2.conf
-rwxr-xr-x# 1 jklo admin 5063 Dec 21 04:08 mvn
-rwxr-xr-x# 1 jklo admin 5985 Dec 21 04:08 mvn.bat
-rwxr-xr-x# 1 jklo admin 5253 Dec 21 04:08 mvnDebug
-rwxr-xr-x# 1 jklo admin 6167 Dec 21 04:08 mvnDebug.bat
-rwxr-xr-x# 1 jklo admin 5539 Dec 21 04:08 mvnyjp
You should use a local install of maven on your machine. You need to tell IntelliJ to use that version of maven in Preferences > Build, Execution, Deployment > Build Tools > Maven > "Maven home directory"
I installed java on my CentOS 6.9:
[root#sample liquibase-3.6.2-bin.z]# java -version
openjdk version "1.8.0_121"
OpenJDK Runtime Environment (build 1.8.0_121-b13)
OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)
then I tried to run liquibase.jar but i got this error:
[root#sample liquibase-3.6.2-bin.z]# ll
total 11368
drwxrwxrwx. 2 db2inst1 db2iadm1 4096 Dec 17 13:10 lib
-rwxrwxrwx. 1 db2inst1 db2iadm1 11358 Jul 3 23:27 LICENSE.txt
-rwxrwxrwx. 1 db2inst1 db2iadm1 1251 Jul 3 23:27 liquibase
-rwxrwxrwx. 1 db2inst1 db2iadm1 884 Jul 3 23:27 liquibase.bat
-rwxrwxrwx. 1 db2inst1 db2iadm1 2167086 Jul 3 23:30 liquibase.jar
-rwxrwxrwx. 1 db2inst1 db2iadm1 7174 Jul 3 23:27 liquibase.spec
-rwxrwxrwx. 1 db2inst1 db2iadm1 3046 Jul 3 23:27 README.txt
drwxrwxrwx. 6 db2inst1 db2iadm1 4096 Dec 17 13:10 sdk
[root#sample liquibase-3.6.2-bin.z]# java -jar liquibase.jar
Error: A JNI error has occurred, please check your installation and try
again
Exception in thread "main" java.lang.NoClassDefFoundError:
ch/qos/logback/core/filter/Filter
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at
sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException:
ch.qos.logback.core.filter.Filter
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
[root#sampleliquibase-3.6.2-bin.z]#
what shoul I do? am i missing something?how can I find these classes?
The error is a general missing class error, and not a JNI error. The error is misleading as it indicates the wrong source of the problem.
Those classes are in the lib/ directory. There is a dos bat file for launching it. The equivalent on unix is something like:
#!/bin/bash -p
for main in liquibase*.jar; do
cp=$main
done
for i in lib/*.jar; do
[[ -f $i ]] && cp=$cp:$i
done
java -classpath $cp liquibase.integration.commandline.Main "$#"
however, this yields the error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
which indicates another missing library - simple logging for java.
To address this problem. You need a copy of slf4j. Downloading the latest binary zip, and extracting the api file - it'll be called sl4j-api-<version>.jar into the lib directory of liquibase should allow you to get a little bit further.
Octave 3.8.2, OS X 10.10.4
I used
ml_jar_version=javaMethod('getProperty','java.lang.System','java.version');
ml_jar_version=['Java ' ml_jar_version];
to check the java version and I got
ml_jar_version = Java 1.6.0_65
However, I want Octave to use JDK 1.7 and so I typed
setenv("JAVA_HOME","/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home");
but ml_jar_version did not change.
My question is: how to make Octave to use JDK 1.7?
Edit 1: my Octave was installed through homebrew. I believe homebrew just downloaded precompiled binaries. The following is the configuration of my Octave installation:
homebrew/science/octave: stable 3.8.2 (bottled), HEAD
a high-level interpreted language for numerical computations.
https://www.gnu.org/software/octave/index.html
/usr/local/Cellar/octave/3.8.2_1 (2111 files, 54M)
Poured from bottle
/usr/local/Cellar/octave/3.8.2_2 (2111 files, 54M) *
Poured from bottle
From: https://github.com/homebrew/homebrew-science/blob/master/octave.rb
==> Dependencies
Build: pkg-config ✔, gnu-sed ✘
Required: pcre ✔, qscintilla2 ✔, qt ✔, pstoedit ✔
Recommended: gnuplot ✔, suite-sparse421 ✔, readline ✔, arpack ✔, fftw ✔, glpk ✔, gl2ps ✔, graphicsmagick ✔, hdf5 ✔, qhull ✔, qrupdate ✔, epstool ✔, ghostscript ✔
Optional: openblas ✘
==> Options
--with-jit
Use the experimental JIT support (not recommended)
--with-native-graphics
Use native OpenGL/FLTKgraphics (does not work with the GUI)
--with-openblas
Use OpenBLAS instead of native LAPACK/BLAS
--without-arpack
Build without arpack support
--without-check
Skip build-time tests (not recommended)
--without-curl
Do not use cURL (urlread/urlwrite/#ftp)
--without-docs
Don't build documentation
--without-epstool
Build without epstool support
--without-fftw
Do not use FFTW (fft,ifft,fft2,etc.)
--without-ghostscript
Build without ghostscript support
--without-gl2ps
Build without gl2ps support
--without-glpk
Do not use GLPK
--without-gnuplot
Do not use gnuplot graphics
--without-graphicsmagick
Build without graphicsmagick support
--without-gui
Do not build the experimental GUI
--without-hdf5
Do not use HDF5 (hdf5 data file support)
--without-java
Build without java support
--without-qhull
Do not use the Qhull library (delaunay,voronoi,etc.)
--without-qrupdate
Do not use the QRupdate package (qrdelete,qrinsert,qrshift,qrupdate)
--without-readline
Build without readline support
--without-suite-sparse421
Do not use SuiteSparse (sparse matrix operations)
--without-zlib
Do not use zlib (compressed MATLAB file formats)
--HEAD
Install HEAD version
It seems that octave reads the symbolic link 'dafault-java', here:
/usr/lib/jvm/default-java
$ls -al
drwxr-xr-x 5 root root 4096 нов 19 21:37 .
drwxr-xr-x 181 root root 12288 нов 19 20:45 ..
lrwxrwxrwx 1 root root 14 нов 19 21:37 default-java -> java-8-openjdk-amd64/
lrwxrwxrwx 1 root root 20 апр 23 2016 java-1.8.0-openjdk-amd64 -> java-8-openjdk-amd64
-rw-r--r-- 1 root root 2600 окт 27 21:06 .java-1.8.0-openjdk-amd64.jinfo
drwxr-xr-x 8 root root 4096 нов 19 20:45 java-7-oracle
-rw-r--r-- 1 root root 2543 нов 19 20:45 .java-7-oracle.jinfo
drwxr-xr-x 7 root root 4096 нов 19 21:37 java-8-openjdk-amd64
drwxr-xr-x 2 root root 4096 нов 16 20:28 openjdk-8
You need to change it to point to your java folder :
First remove it:
$sudo rm default-java
Then make a new symbolic link (java-7-oracle in my case):
$ln -s java-7-oracle/ default-java
It shoud work afterwards.
In octave:
>> javaMethod('getProperty','java.lang.System','java.version')
ans = 1.7.0_80
I am trying to run jconsole from my machine but I can't find the location of the .sh . I have tried finding it in different directories and setting JAVA_HOME to the jdk.
$which java
/usr/bin/java
$java -version
java version "1.7.0_51"
OpenJDK Runtime Environment (rhel-2.4.4.1.el6_5-x86_64 u51-b02)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
$whereis java
java: /usr/bin/java /etc/java /usr/lib/java /usr/share/java /usr/share/man/man1/java.1.gz
I looked in /usr/lib/jvm and I found
drwxr-xr-x. 3 root root 4096 Apr 23 2013 java-1.5.0-gcj-1.5.0.0
drwxr-xr-x. 3 root root 4096 Jan 27 2014 java-1.6.0-openjdk-1.6.0.0.x86_64
drwxr-xr-x. 3 root root 4096 Feb 5 2014 java-1.7.0-openjdk-1.7.0.51.x86_64
lrwxrwxrwx. 1 root root 21 Feb 5 2014 jre -> /etc/alternatives/jre
lrwxrwxrwx. 1 root root 27 Apr 23 2013 jre-1.5.0 -> /etc/alternatives/jre_1.5.0
lrwxrwxrwx. 1 root root 26 Apr 23 2013 jre-1.5.0-gcj -> java-1.5.0-gcj-1.5.0.0/jre
lrwxrwxrwx. 1 root root 27 Feb 5 2014 jre-1.6.0 -> /etc/alternatives/jre_1.6.0
lrwxrwxrwx. 1 root root 37 Feb 5 2014 jre-1.6.0-openjdk.x86_64 -> java-1.6.0-openjdk- 1.6.0.0.x86_64/jre
lrwxrwxrwx. 1 root root 27 Feb 5 2014 jre-1.7.0 -> /etc/alternatives/jre_1.7.0
lrwxrwxrwx. 1 root root 38 Feb 5 2014 jre-1.7.0-openjdk.x86_64 -> java-1.7.0-openjdk-1.7.0.51.x86_64/jre
lrwxrwxrwx. 1 root root 25 Apr 23 2013 jre-gcj -> /etc/alternatives/jre_gcj
lrwxrwxrwx. 1 root root 29 Feb 5 2014 jre-openjdk -> /etc/alternatives/jre_openjdk
and in java-1.7.0-openjdk-1.7.0.51.x86_64/jre/bin/, I only found
[root#portal01 bin]# ll
total 200
-rwxr-xr-x. 1 root root 9536 Jan 14 2014 java
-rwxr-xr-x. 1 root root 9656 Jan 14 2014 keytool
-rwxr-xr-x. 1 root root 9856 Jan 14 2014 orbd
-rwxr-xr-x. 1 root root 9688 Jan 14 2014 pack200
-rwxr-xr-x. 1 root root 10984 Jan 14 2014 policytool
-rwxr-xr-x. 1 root root 9648 Jan 14 2014 rmid
-rwxr-xr-x. 1 root root 9656 Jan 14 2014 rmiregistry
-rwxr-xr-x. 1 root root 9688 Jan 14 2014 servertool
-rwxr-xr-x. 1 root root 9896 Jan 14 2014 tnameserv
-rwxr-xr-x. 1 root root 92264 Jan 14 2014 unpack200
..even though there are 200 files. How can I find and run jconsole?
jconsole is part of the Java SDK, it appears you only have the JRE installed.
You can run jconsole directly from your terminal by running the command jconsole.
reena#IM-1500:~$ jconsole
It will launch java monitoring console dialog.
From https://serverfault.com/questions/179908/fedora-jconsole-location:
Try running: yum provides */jconsole
that will tell you what package you need as well as where it's located in the package.
Once you set the path of JDK in Linux then this command execute easily might be you had not included the JAVA_HOME with PATH variable.
plz follow this discussion
If you have Java JDK installed in your Linux machine, usually jconsole is located at /usr/bin/ as a symbolic link.
Example from my Linux VM running Centos6
$ which jconsole
/usr/bin/jconsole
$ ls -l /usr/bin/jconsole
lrwxrwxrwx. 1 root root 26 Sep 4 10:05 /usr/bin/jconsole -> /etc/alternatives/jconsole
$ ls -l /etc/alternatives/jconsole
lrwxrwxrwx. 1 root root 51 Sep 4 10:05 /etc/alternatives/jconsole -> /usr/lib/jvm/java-1.7.0-openjdk.x86_64/bin/jconsole
But you mentioned you got the a command not found error when you typed jconsole at the prompt. Can you find if jconsole is available in one of the jdk's bin directory?
$ ls -l /usr/lib/jvm/java-1.7.0-openjdk.x86_64/bin | grep jconsole
If yes, then add this in your PATH environment variable like so
$ export PATH=$PATH:/usr/lib/jvm/java-1.7.0-openjdk.x86_64/bin
or put this in your ~/.bashrc if you are using Bash.
If jconsole is not there, then maybe you need to try another jdk which you have installed or re-install the jdk.
Please install JDK Development Package to get Jconsole