• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

exe of a jar file + passing parameter from cmd prompt to exe

 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

can we create an EXE of a jar file. the extension should be exe for Eg : testJar.exe

and can we pass parameter to the exe from comand prompt

for Eg :

C:\tesJar.exe 9969413222 Jigar

the functionality of the testJar.exe is to get the parameter and log it into the file system.

can it be possible ?

Thanks & Regards.
Jigar Naik
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can create a batch file (a.k.a. shell script) that runs the jar file and passes in whatever parameters it received.

Or is the objective to create native code?
 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well we have another application which was written in C++ which has opetion in GUI for executing .exe files.

so batch wont work. plus we have to pass arguement to exe. at run time.
 
Rob Spoor
Sheriff
Pie
Posts: 20514
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can call java.exe or javaw.exe:

If it is a windowed application use javaw.exe, otherwise use java.exe

If you need the full path to java.exe, you can use %WINDIR%\system32 as the path, which usually translates to C:\WINDOWS\system32
 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Rob,

Thanks a lot, I think that should work fine.

Regards,
Jigar Naik
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic