Ver Mensaje Individual
  #1  
Antiguo 10-06-2014
Avatar de jscubillos5
jscubillos5 jscubillos5 is offline
Miembro
NULL
 
Registrado: jul 2013
Ubicación: Bogotá
Posts: 44
Reputación: 0
jscubillos5 Va por buen camino
Question Ejecutar archivo .JAR desde DElphi

Hola comunidad he estado buscando como ejecutar un archivo .JAR desde delphi, (XE5), y he encontrado varia información al respecto: http://www.clubdelphi.com/foros/showthread.php?t=41916, pero las he probado y ninguna me ha funcionado, actualmente este es el código de pascal que tengo:

Código Delphi [-]
if (FileExists('API_WS_SDL_SIMPLE/API_WS_SDL_SIMPLE.jar')) then
       begin
         LineaDeComandos:= '"' + '1' + '"' + ' ' + '"' + '1' + '"' + ' ' + '"' + IntToStr(IDTIPODOCUMENTO) + '"' + ' ' + '"' + NUMERODOCUMENTO + '"' + ' ' + '"' + CORREO +
         '"' + ' ' + '"' + DIRECCION + '"' + ' ' + '"' + TELEFONO + '"' + ' ' + '"' + '14' + '"' + ' ' + '"' + IntToStr(IDDEPARTAMENTOEXPEDICIONDOCUMENTO) + '"' + ' ' + '"' + 
        IntToStr(IDCIUDADEXPEDICIONDOCUMENTO) + '"' + ' ' + '"' + '14' + '"' + ' ' + '"' + IntToStr(IDDEPARTAMENTODOMICILIO) + '"' + ' ' + '"' + IntToStr(IDCIUDADDOMICILIO) +
        '"' + ' ' + '"' + DateToStr(FECHAEXPEDICIONDOCUMENTO) + '"' + ' ' + '"' + DateToStr(FECHANACIMIENTO) + '"' + ' ' + '"' + PRIMERAPELLIDO + '"' + ' ' + '"' + SEGUNDOAPELLIDO +
        '"' + ' ' + '"' + NOMBRES + '"' + ' ' + '"' + '14' + '"';
         //WinExec(LineadeComandos, SW_SHOWMINNOACTIVE);
         ShellExecute(0,'open','JAVA API_WS_SDL_SIMPLE.JAR', PChar(LineadeComandos),'API_WS_SDL_SIMPLE/',SW_SHOWNORMAL);
         while not FileExists('API_WS_SDL_SIMPLE/' + NUMERODOCUMENTO + '.fin') do
         begin
           Sleep(1);
         end;
       end
       else
       begin
         Respuesta:= 'Atención ha ocurrido un error Critico, por favor detenga todos los procesos e informe al area de sistemas el error: Not exist API_WS_SDL_SIMPLE, not connection with Deceval';
         raise Exception.Create(Respuesta);
       end;

Pero pues no me funciona esta no ejecuta el .jar, adicionalmente tengo un .bat con el siguiente comando:

java -jar API_WS_SDL_SIMPLE.jar "1" "1" "1" "1018458060" "JCUBILLOS@AUDISOFT.COM" "CR 78 # 1-03" "2936359" "14" "5" "150" "14" "6" "151" "08-06-2014" "08-06-2014" "C" "G" "JUAN" "14"
PAUSE

Y este si funciona, ¿Podria alguno de ustedes ayudarme a ejecutar el .jar?
__________________
De ante mano gracias por tomarse el tiempo de leer este Hilo.

-------------------------------
Juan Sebastián Cubillos Gonzalez
Desarrollador de soluciones informáticas.
Bogotá, Colombia.
Encuentra me en: http://www.linkedin.com/pub/juan-seb...lez/66/1b8/150

Última edición por Casimiro Notevi fecha: 10-06-2014 a las 01:24:54.
Responder Con Cita