Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Execute jar file on qmc

Hi guys, i struggling with following problem:

i have a jar file and i want to excute in script:

EXECUTE cmd.exe /C "java -jar D:\myfile.jar > D:\test.csv";

When i run the script in Qlikview Desktop it works. But when I´m doing a reload in QMC it doesn`t work. indeed the file was created then but with noting in it and size = 0

I´ve tried a lot of suggestions like changing security settings but nothing worked.

Hopefully someone can help me out here.

Thank you

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

The error log indicates that the path is not included in the PATH environment variable for the particular account that runs the load script. Just logging in as a different user on the same computer and running the QlikView Desktop successfully with Java does not prove that the environment for the other user is set up properly.

You might be able to run the Java program successfully if you have something like this:

EXECUTE cmd.exe /C "C:\ProgramFiles\Java\jre_1.8.0_73\bin\java.exe -jar D:\myfile.jar > D:\test.csv  2>D:\myfile-jar-errorlog.txt";


Or if you make a change to the PATH environment variable for the entire system and include the path to java.exe binary you could use your "old" command line ...


View solution in original post

7 Replies
petter
Partner - Champion III
Partner - Champion III

This kind of execution demands that the User Account that the Load Script is executing as on the QlikView Server/Publisher has the same environment variables as your Desktop Account. The Java environment and rights to the Java executables has to be the same.

Not applicable
Author

hello petter,

thank you for your answer.

I´m sorry but don`t exactly understand what you mean. I already set a system variable for jre

So what is your suggestion on this?

petter
Partner - Champion III
Partner - Champion III

I have to ask some basic questions as I have no idea how your environment looks like:

- Have you or someone installed Java at all on the computer that runs the QMC?

- Have all the requirements for Java been installed and configured on that computer?

Additionally you can also catch error messages from the EXECUTE by also including 2>error.log like this:

EXECUTE cmd.exe /C "java -jar D:\myfile.jar > D:\test.csv  2>D:\myfile-jar-errorlog.txt";


If the Java interpreter and or JVM or the Java program for some reason has some problems they will not be reported to standard output but to standard error output which can be redirected by using 2>



Not applicable
Author

Hi Petter,

- Qlikview and all its components like Qlikview Server is running on a Windows Server 2012

- On this Server there is also installed jre1.8.0_73

- like I said with Qlikview Desktop it's working. So I think it's configured properly

My errorlog is:

"'java' is not recognized as an internal or external command,

operable program or batch file."

Thank you

petter
Partner - Champion III
Partner - Champion III

The error log indicates that the path is not included in the PATH environment variable for the particular account that runs the load script. Just logging in as a different user on the same computer and running the QlikView Desktop successfully with Java does not prove that the environment for the other user is set up properly.

You might be able to run the Java program successfully if you have something like this:

EXECUTE cmd.exe /C "C:\ProgramFiles\Java\jre_1.8.0_73\bin\java.exe -jar D:\myfile.jar > D:\test.csv  2>D:\myfile-jar-errorlog.txt";


Or if you make a change to the PATH environment variable for the entire system and include the path to java.exe binary you could use your "old" command line ...


Not applicable
Author

Are you running the desktop client in the Server ?

You publisher node have Java installed ?

Have you ever tried to run manually on the server cmd ?

Instead of running on the QV Script, in Qlikview 11 you can exucute the batch commands directly on the server

  System --> Supporting Tasks

First fix your path variable & use supporting tasks.

Not applicable
Author

With your suggestion it works now!

Thank you very much, Petter!