Error while running Jprofile8 - jprofiler

I am getting following error while running /tmp/jprofiler8/bin/jpenable
No suitable Java Virtual Machine could be found on your system.
The version of the JVM must be at least 1.6 and at most 1.7.
Please define INSTALL4J_JAVA_HOME to point to a suitable JVM.
You can also try to delete the JVM cache file
I have also set INSTALL4J_JAVA_HOME to point to suitable JVM.
Java version on my machine is 1.4.2.
Can anyone please suggest what might be wrong or missing?

Unfortunately you did not mention details about your environment, so I don't know which Linux distribution you use.
There are some options though:
install a current JRE alongside the installer for JProfiler
As you can't install or update Java, you could provide a JRE in a kind of "portable application" setup. Simply unzip the server jre Oracle provides or (if you are not on an x64 architecture) unzip the jdk you also can download from Oracle.
But if the code you want to profile is limited to your pre-installed Java 1.4 you will run into another problem, because as far as I know Java 1.5 is the minimum JProfiler expects
use a different machine for profiling
Unless your code depends heavily on the environment you run it in you can even take a Windows 8.1 machine and profile the code there. Code that is slow is slow on any operating system. Or make use of a different Linux computer.

Related

Can you make WSL interface with windows installs? [duplicate]

How do I avoid installing same programming languages both in WSL and Windows10?
I am thinking about using WSL as a dev workspace. However, I realized I will need to install Node.js, Python, create-react-app, and so on in WSL even though my windows 10 already have them installed.
It would be helpful if you could spare me some advice.
Thanks.
To some degree, it depends on what type of development you are doing. Given your example languages/tools, I'm going to assume that most of your development is platform agnostic, web-development, etc.
My recommendation is to go all-in on WSL and install the Linux versions of the tools you use (with some notable exceptions covered below).
Uninstalling the Windows versions is recommended, but not strictly necessary. I recommend uninstalling because I continue to see a number of questions across the Stack sites where it becomes apparent that the Windows version of Node or Python is getting called from inside WSL. It's likely that some tool, such as nvm or equivalent, attempted to prepend the Windows Node or Python location to the Linux path.
This causes problems, as the Windows versions Node and Python understand Windows paths and processes. When you call them from the Linux shell in WSL, the shell/OS uses, of course, the Linux versions. And Windows Python just won't understand something like /mnt/c/Projects. It needs C:\Projects. You can work around this with utilities such as wslpath (automatically installed in some WSL distributions, installable in all others), or you could just manually adjust the path. But ... why go through the hassle if you don't need to.
Just use the Linux versions, with the corresponding Linux paths and instructions. Most development tools, tutorials, instructions, etc. are going to "default" to the Linux doc. It will typically be more complete, more up-to-date, etc.
And, of course, the Linux command-line experience is (subjectively, sure) far-and-above better than PowerShell. Don't get me wrong, I like PowerShell, but I like PowerShell even better when I call it through WSL (powershell.exe or pwsh.exe), since I can take advantage of Linux niceties like less (or bat), jq, and many others.
Not to say there aren't WSL caveats that you have to get used to. Be prepared to run into a few snags here and there (lack of Systemd support, permissions, filesystems, inotify), but most everything has a workaround that you'll typically find here on Stack (Stack Overflow, Ask Ubuntu, Unix & Linux, and/or Super User) if you search.
And for those "notable exceptions" I mentioned, I recommend installing:
Windows Terminal (available in the Microsoft Store), which will provide an upgraded terminal experience for WSL.
The Windows version of Visual Studio Code -- I've seen a question from someone here who tried to install the Linux version. It's just not necessary. Microsoft has done a great job of integrating the Windows version of VSCode with WSL. Just install the "Remote Development" extension pack, which includes the "Remote - WSL" extension.

Where to download Hotspot JVM? Different from Oracle's JVM?

I read a few posts about JVM at Stack Overflow and would like to download a binary copy of the Hotspot JVM, yet I am not able to find it on http://www.java.net.
Beside that, what is the difference between Hotspot JVM and JVMs found at Oracle
Is Oracle JVM good for a production website?
Overview:
This SO question may clear up your questions regarding "What is JVM, Hotspot and OpenJDK".
Basically:
JVM means Java Virtual Machine. The JVM is the underlying runtime that executes java bytecode. There are multiple different implementations out there, all implementing the Java Virtual Machine Specification
HotSpot is the most used implementation of the JVM concept. It is used in both, Oracle JDK and OpenJDK. Oracle's JDK can be downloaded on oracle's website, currently http://www.oracle.com/technetwork/java/javase/downloads/index.html. This is "the typical JVM you will find on a normal user's windows machine".
OpenJDK is the open source project maintaining and impelmenting the HotSpot JVM, but also many other projects beside the JVM such as Graal or VisualVM. On Ubuntu for example you can install this OpenJDK (current version 8) by running sudo apt-get install openjdk8.
Conclusion:
While this explaination is not really perfect, it may be good enough to understand that there is no big difference between Oracle JDK and OpenJDK. If you are interested in a little more info on this, have a look at the SO question Differences between Oracle JDK and Open JDK
JDK / JVM sourcecode:
If you are interested in the source code, OpenJDK is the way to go. Here you can find the current OpenJDK 8 (which includes the HotSpot JVM). Its source code can be found here. It also states how to download the source code:
The jdk8u-dev forest for ongoing development can be cloned using this command: hg clone http://hg.openjdk.java.net/jdk8u/jdk8u-dev;cd jdk8u-dev;sh get_source.sh .
The corresponding master forest jdk8u can be cloned using this command: hg clone http://hg.openjdk.java.net/jdk8u/jdk8u;cd jdk8u;sh get_source.sh .
In addition, the source code for the last release, 8u66, is available by cloning the 8u master forest : http://hg.openjdk.java.net/jdk8u/jdk8u and using the 'jdk8u66-b17' mercurial tag.

Spring data redis mock

I need to do integration testing for a spring cloud application running with spring data on redis.
Tests work locally with the regular redis server instance and I need to run this on a Jenkins CI server that is controlled by the corporate CI engineering group.
Obviously I can attach to a redo server there so I used an embedded redis server (from here: https://github.com/kstyrc/embedded-redis).
Running tests locally with this redis server works well since there is a test profile to inject the embedded server in place of the production one.
Now the problem is that when we run this in the Jenkins environment this is the error we see.
/tmp/1430170830037-0/redis-server-2.8.19: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /tmp/1430170830037-0/redis-server-2.8.19)
So this version of redis has specific dependency on a specific version of glibc. I tried a couple of other libraries but they all depend on the same underlying version of the embedded redis server.
Is there a spring data mock framework that can be used to get around this sort of issue?
This might come a little late for you, but there is indeed a Spring Data Mock framework that you can use, which let's you mock repositories (regardless of the specific backend solution) without a real database connection.
Here is a link: https://github.com/mmnaseri/spring-data-mock
You don't have a high enough version of libc6, that is causing the error.
From How to fix “/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found”? – Super User:
That means the program was compiled against glibc version 2.14, and it requires that version to run, but your system has an older version installed. You'll need to either recompile the program against the version of glibc that's on your system, or install a newer version of glibc (the "libc6" package in Debian).
So, you just need to upgrade your libc6 package. All versions of Ubuntu have at least version 2.15 because it's a faily important package (reference).
To upgrade it, use these commands in a terminal:
sudo apt-get update
sudo apt-get install libc6
p.s. This is answer from askubuntu.com by minerz029

This java instance does not support a 64-bit JVM

I home host a Minecraft server and I just updated Java to update 65, the server worked perfectly before updating but now, it says
"This Java instance does not support a 64-bit JVM. Please install the desired version."
Installing 32-bit Java doesn't help and this also happens when I run my Minecraft client.
I have 64-bit Windows 7 running 64-bit Java 7.
If anybody can help that would be great.
EDIT: Fixed it, apparently I'm just an idiot and had 32-bit installed when I updated java, and since I thought I had 64-bit installed I never thought to re-install it. Sorry for wasting your time
As the author stated, the solution was pretty simple. Bringing it to an answer to help future users
This java instance does not support a 64-bit JVM
This error is associated with your System looking for a Java 64-bit Virtual Machine and not finding any.
To solve it, you must make sure that the 64-bit Java is installed. The problem the OP had was: He assumed he had the 64-bit installed, but he did not.
To download Java, access Java Website
Because you are using 64 bit minecraft client, you are not able to work even with 32 bit JVM.
Kindly install all the things, mincraft server,client, JVM of 32 bit only. You can run it definitely. If still not able to work, let me know with exact error message you are getting.

OpenJDK's JDK location

I'm running Minecraft on a headless Linux server with OpenJDK. I've added a bunch too many mods and its lagging (even on my local network) without using too much CPU or memory (e.g. its lagging, but its still got resources it can use). So I'm pretty sure its a mod fault.
To save the hassle of removing/adding mods one by one to see whats causing the error, my research led me to VisualVM where you can profile the java application and see which entities are doing what and with what resources. With any luck it should point out the mod consuming the most resources, and the most ticks.
Given its a headless server, and VisualVM is a window/GUI application, I've successfully managed to get it running and passing the GUI back to my Windows client using X over SSH.
Trouble is now, that its telling me that I need to use JDK and not JRE. Which is fair enough. Except OpenJDK has JDK in its name, rendering all googling futile. I cannot for the life of me, find if JDK is included in OpenJDK, what its named, and where it may be located. The other problem is, most of the troubleshooting guides I find are for Windows, and dont help me find the JDK on linux.
As some background information, I'm running Debian, and I know OpenJDK's JRE is installed here: /usr/lib/jvm/java-7-openjdk-amd64/jre
Can someone tell me please, if JDK is in OpenJDK, or I need to install it as well? If I do need to install it, is there an OpenJDK equivelant for JDK? If its already included, can someone provide some tips on locating it, so I can point VisualVM at it instead of the JRE?
The OpenJDK has a JDK, but there is also a cut down version which is just the JRE. I would use locate javac and if it can't find it, you need to install the JDK.