-1

I have executable java apps (as "exe" file) that actually java wrapper executable. is there a way to grep the java command / parameter from the exe java apps.

Thanks.

3 Answers3

0

In case of a classical main-function you will find the commands in args parameter:

public static void main(String[] args) {
  for (String s : args){
     System.out.println(s);
  }
}
nano_nano
  • 12,351
  • 8
  • 55
  • 83
0

Your question is not so clear, but a I try to answer.

If you are passing parameters from a wrapper exe to a java executable, you oblviosly know which parameters are passing in the exe.

If you need to know passed parameters in java application, instead, you probably have a main matod in this app. This method is declared as follow:

public static void main(String[] args){}

Where args array is exactly what you need: here you find the parameters passed to the java executable. All you have to do is to use this array.

davioooh
  • 23,742
  • 39
  • 159
  • 250
0

You can connect to the java process using Java Visual VM and inspect some of the properties on the VM, like the system properties, memory settings and more. The tool is available in JDK bin/jvisualvm Visual VM page. You may have to try to connect to the available VMs from the list one by one to find yours. Eclipse appears as but I was able to see JVM args and system properties for it.

hidralisk
  • 706
  • 6
  • 18