Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

launch an exe prog from a servlet

Posted on 2001-07-10
6
266 Views
Last Modified: 2013-11-24
I launch an executable program from a servlet with

Process proc = Runtime.getRuntime().exec("d:\\servlets\test.exe")

This exe use some dll to access a SYBASE database
(d:\Sybase\dll\...) and when i try the servlet, i get a message on the server:

the dll libcs.dll can not be found in the specified path
d:\servlets\;.;c:\winnt\system32;c:\winnt\system;c:\winnt;c:\winnt;c:\winnt\system32;

and test.exe is not executed.

There is no probleme when i launch test.exe in MS-DOS (or by double-clicking on it) or when i put test.exe in d:\sybase\dll and then try to lauch it with the servlet
but it should not stay in this directory.

d:\Sybase\dll\ is in my PATH

can somebody help me please ?

Laurent.
0
Comment
Question by:laurentj
  • 3
  • 2
6 Comments
 
LVL 92

Accepted Solution

by:
objects earned 200 total points
ID: 6268521
The Sybase dll is not in the path used by the servlet:
d:\servlets\;.;c:\winnt\system32;c:\winnt\system;c:\winnt;c:\winnt;c:\winnt\system32;

Either add d:/sybase/dll to the path used by your servlet container, or pass a suitable environment via the exec call.
0
 
LVL 2

Expert Comment

by:mgaurav
ID: 6269153
Give the path "d:\sybase" in the environment path, that's the least you can do.
0
 

Author Comment

by:laurentj
ID: 6269355
My servlet run with APACHE/JSERV.
I change Jserv.properties :

 wrapper.path=d:\sybase\dll

and it works !

thanks.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Comment

by:laurentj
ID: 6269365
My servlet run with APACHE/JSERV.
I change Jserv.properties :

 wrapper.path=d:\sybase\dll

and it works !

thanks.
0
 
LVL 92

Expert Comment

by:objects
ID: 6271441
Good to hear :)
Thanks for the points.
0
 

Author Comment

by:laurentj
ID: 6272329
another problem :

i use

Process proc = Runtime.getRuntime().exec("d:\\servlets\test.exe \"my string     end of string\"")

and when i display the param that test.exe get :
"my string end of string" and not
"my string     end of string" (spaces are reduce to one space !)

i try with a test.bat (echo %1) and i get the same pb !

any idea ?
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
null output 3 35
JAVA API design with micro service cloud in mind 1 46
Html Table Looping (part 2) 5 27
American Express @Work site and Java 4 24
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question