Executing Java Mission Control from command line - linux

I have copied the JMC 7.0 binaries in linux. Any idea on how to start the application from commandline or do we need GUI to be enabled in linux ?
Thanks,
Naveed

There is no headless mode of JMC, but you can start a recording and open it from the shell.
java -XX:StartFlightRecording:filename=dump.jfr -version
./jmc -openFile dump.jfr

Related

Blank screen appears when i try to open Jmeter in GUI mode in Cent OS

I am setting up a new Jmeter 5.0 on Cent OS. I tried to open it in GUI mode using terminal.
I also tried to replace all lib jars and open Jmeter using terminal.
Jmeter must open in GUI mode so i can debug my scripts.
Navigate to Jmeter/bin/
execute the below command in the terminal
sh jmeter.sh
Hopefully you can see the GUI.

How to open a VS Code IDE from Linux subsystem on Windows?

I'm running a Linux subsystem with an Ubuntu terminal inside Windows 10 - I wanted to make use of the functionalities of both operating systems without partitions or virtual machines.
In an Ubuntu terminal on Linux, I use the command 'code .' to open up the VS Code IDE but it doesn't seem to work when the terminal is part of a subsystem on Windows.
I can open up the IDE from Windows 10 and set my path into the Linux system but I remember reading some guidance that it's okay to save files from the Linux onto the Windows side but not vice versa.
Any solutions are much appreciated, thanks in advance!
If you wish to invoke windows binaries from WSL (Windows Subsystem for Linux) like for the example you want to run visual-studio-code, you can do so by setting your visual-code's installation directory into your %PATH% system variable and invoking it using this way
$ [application-name].exe notice the .exe is important.
And this interoperability is added in the Fall Creator Update of windows.
You can follow this documentation from Microsoft for more help.

How to install DCEVM for Java 7 in Linux?

The main site of DCEVM didn't clearly explain how to install DCEVM on Linux. Running "java -jar installer.jar" in Linux (when accessed via PuTTy) gave me the following exception.
[admin#LINUXBOX jdk1.7.0_55]$ java -jar DCEVM-full-7u79-installer.jar
java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207)
at java.awt.Window.<init>(Window.java:535)
at java.awt.Frame.<init>(Frame.java:420)
at javax.swing.JFrame.<init>(JFrame.java:224)
at com.github.dcevm.installer.MainWindow.<init>(MainWindow.java:43)
at com.github.dcevm.installer.Main.main(Main.java:46)
Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207)
at java.awt.Window.<init>(Window.java:535)
at java.awt.Frame.<init>(Frame.java:420)
at java.awt.Frame.<init>(Frame.java:385)
at javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1757)
at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1832)
at javax.swing.JOptionPane.getRootFrame(JOptionPane.java:1697)
at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:863)
at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:667)
at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:638)
at com.github.dcevm.installer.Main.main(Main.java:51)
If required, I am also ready to use a Virtual Box installed Desktop Linux to try it, which then I can copy (patched JDK) into my original Linux box thereafter.
So, how can I install DCEVM on Linux (for Java 7)? Do I need a Desktop-based Linux for that?
EDIT:
Here's the output of few commands suggested by the first answer by Sharad:
[admin#TESTBEDPEGSEARCH jdk1.7.0_55]$ echo $DISPLAY
[admin#TESTBEDPEGSEARCH jdk1.7.0_55]$ java -version
java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)
EDIT2:
I am using DCEVM in Windows for quite a long time.
echo $DISPLAY should print :0 . If it is not printing :0 Then you should set display variable using this command "export DISPLAY=127.0.0.1:0.0" . I hope it will work
Step 1:--Check for the display variable set on your machine using echo
echo $DISPLAY
ensure It is set on :0
Step 2:-Check for your JAVA version Using
java -version
My Centos machine is reflecting:--
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)
Step 3:-- I run java -jar DCEVM-full-7u79-installer.jar command
It works for me.
The DISPLAY variable is only set when a X11 session is active. When you login on a remote machine with ssh, this usually is not the case.
There are two possible solutions:
install a X server on Windows (e.g. XMing) and enable X11 forwarding in your Putty session (Connection > SSH > X11). This will show the installer on your Windows PC.
log in on the Linux host in a graphical session, this will automatically set the DISPLAY variable.
Note: I have not installed this but i happened to find a guide with video which may help you.
Please read the section with this heading Install DCEVM to hot redeploy more complicated changes
https://vaadin.com/blog/-/blogs/getting-started-with-vaadin-development-using-eclipse-maven

How can I change how eclipse invokes gdb in linux?

In short, I need to understand how to configure eclipse to run "optirun gbd" instead of "gdb". An explanation of what exactly I'm trying to accomplish follows.
I need to run my debug app in eclipse such that it will use the nvidia optimus card instead of the integrated card. My app requires opengl support that is only available this way.
I've got a laptop with an nvidia optimus video card. I'm running linux (ubuntu). I've successfully set up bumblebee such that I can take advantage of the optimus technology. This requires that, to use the nvidia card, I run a given program "foo" with the program "optirun:" optirun foo.
I need to configure eclipse to launch my program in debug mode under optirun. If I run from command line: optirun gdb app everything works as expected.
Edit: Changing the "GDB Debugger" field inside the debug configuration to optirun gdb does not work. Lanching eclipse by optirun eclipse does, however. But this is a detriment to battery life.
Go to "Debug Configurations", open "Debugger" tab. Change "GDB debugger" from gdb to optirun gdb.
Works in Eclipse Juno, Ubuntu 12.04.
Since I'm sure eclipse uses the shell to execute the program, a workaround is to alias gdb to optirun gdb in ~/.bashrc
I look into this issue today and I found another solution. As long as you have Bumblebee installed (http://www.bumblebee-project.org/) and you know you can attach optirun to an executable (try with glxgears for example) you can attach it to cuda-gdb.
What I did is create a script:
#!/bin/bash
optirun /usr/local/cuda/bin/cuda-gdb $*
And save it to /usr/local/cuda/bin or somewhere else it doesn't matter, with the appropriate permissions for execution (755).
What it does is very simple, it runs optirun cuda-gdb args where args is whatever the command line sends it.
In terminal just run opti_cuda-gdb with or without arguments.
For example I named it opti_cuda-gdb and placed it in that directory (which conveniently is added to the path if CUDA is properly configured).
If you use an IDE to develop, like say Netbeans, point the debbuger executable to that script.
I've been successfully compiled and debbuged code using CuSparse and CuBlas with NetBeans running in a SAMSUNG SF410 with Nvidia Optimus and Ubuntu 11.04 and 11.10.
I'm open to provide further details if you think I omitted something.

Bootable Qt-Linux Application

How to boot a linux kernel + dependencies and auto run a Qt application so the linux environment doesn't show up (only the Qt GUI is visible)?
on x86 PCs
should be able to run from RAM (of course)
Perhaps you could look at how this guy did it:
http://www.embedded-bits.co.uk/2011/1-second-linux-boot-to-qt/
You could start with a minimal linux distribution such as Ubuntu Server and install only X-Windows (without any Window Manager) on top of it: https://help.ubuntu.com/community/ServerGUI
Then, start your Qt application by adding a call to it in the .xinitrc initialization script.
Might be helpfull Linux Journal KDE Kiosk Mode
Why not run x server without window manager and the running the application in full screen mode on that x server.
to start x server type startx
and then you must run your application in fullscreen mode
(your app must support this mode by argument switch like this)
./myapp --fullscreen
I have never tried this, but try google for 'framebuffer'. It should allow you to run a single application with no need for X server.

Resources