1

Is it possible to run an application with a javaagent without calling java -javaagent:MyJavaAgent -jar MyAppToRun with a batch file ? (To call the javaagent directly when the app is launching, without passing by an batch file)

If yes, how? By modifying the manifest file of MyAppToRun? By modifying is code?

Thanks!

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
  • 1
    Short question: why is the mentioned approach not sufficient ? – Marged Feb 13 '16 at 19:42
  • Because this is an java game hosted on a web server, I don't have the right to modifying the launch argument, but I've the right to add it what I wan't, with javaagent, but I don't know how to do. So do you have an idea ? –  Feb 13 '16 at 19:48
  • @vrackfall it is possible to start agents after startup of the JVM, see the answers to the linked question – wero Feb 13 '16 at 20:07
  • Doesnt the link also provide info about modifying the manifest ? That should do the job @wero – Marged Feb 13 '16 at 20:18
  • Ok I will see if it's work –  Feb 14 '16 at 01:32
  • I tried to modify the main class of my class like that (what is highlighted is that I added) : http://pastebin.com/tWTPkEJw –  Feb 14 '16 at 02:38
  • Should it work ? Also could I modify this line to add a side like in the command ( -javaagent:MyJavaAgent=-MCSide:Client) : vm.loadAgent(jarFilePath, "PMLCore/PMLPremain.jar"); –  Feb 14 '16 at 02:47

0 Answers0