Page 1 of 1

Running java program

Posted: Fri Oct 18, 2013 9:20 am
by Paul_Ramcharitar
Hi, I would like to run a java program (jar file) located on the IFS from profoundui. I was able to run the program on my PC using profoundui's "runPCCommand()" function.

Re: Running java program

Posted: Sun Oct 20, 2013 9:13 pm
by Scott Klement
I'm not sure I understand what you mean.

You say you can run it on your PC with runPCCommand(). That sounds like it's working... so, what is it that's not working?

Did you want to run it from your RPG program? (If so, please remember that your RPG programs are using IBM's ILE RPG compiler... So there's no difference between running your Java program from an RPG progam that uses PUI than there is from any other RPG program.)

Or, is this Java code a web application... would you like to open it in a browser?

Or, is it an applet that should run in the browser?

Or, something else that I'm not thinking of?

Re: Running java program

Posted: Mon Oct 21, 2013 10:46 am
by Paul_Ramcharitar
Okay, I would like to save my compiled JAR file on the IFS, and have it run from there. I am also passing parameters to the program.

I was able to run it from my PC using:

Code: Select all

runPCCommand("cmd /c java -jar c:/dist/JavaPrint.jar 1 2 " +get(locInfoID));
It was running from the IFS using:

Code: Select all

runPCCommand("cmd /c java -jar \\\\192.xxx.x.x\\disapps\\java\\dist\\JavaPrint.jar 1 2 " +get(locInfoID));

But this method does not work any more. It does not find the jar file.

I am aware that I can run it from my RPG program, but I was hoping I could run it from PUI.

Re: Running java program

Posted: Mon Oct 21, 2013 11:34 am
by Scott Klement
There was a problem with runPCCommand from versions 4.6.4 to 4.6.6. This causes errors when running runPCCommand -- an error message will pop up, and the command will not be run. This was fixed with Profound UI version 4.6.7.

However, the problem would not be that Windows cannot find the JAR file, it would be an error with running any PC command. Could that be the error you're receiving?

If the problem is truly that the command is running and Windows cannot find the JAR file, then this is not an issue with PUI, it's an issue with how your PCs locate files on the network...

Re: Running java program

Posted: Mon Oct 21, 2013 11:46 am
by Paul_Ramcharitar
I didn't get a pop up error while using runPCCommand, so it must be a problem locating the file on the network. I will look into it.

Thanks scott