This question already has answers here:
executing shell scripts in java script or trigger scanner from browser
(2 answers)
Closed 9 years ago.
I want to access a document scanner on client's side so I have created a shell script to perform this action. Is there any way to execute it through a browser applet? Is there a way to make it work on Fedora 18 OS that will allow me to install a plugin like twain? This how I call my script currently:
String[] cmd = {"sh test.sh", "/Path/to my/resource file"};
Runtime.getRuntime().exec(cmd)
You can use Java Web Start or a signed applet.
Related
This question already has answers here:
Propagate all arguments in a Bash shell script
(12 answers)
Closed 3 years ago.
From a shell script, I would like to call a shell script which calls a java program. The parameters to the java program are passed from the first shell script.
shellscript1 --> shellscript2 (set par1) --> Java par1
I have tried to source shellscript2 in shellscript1. Still couldnt pass parameters. I dont want to export the parameters and call shellscript2
Any ideas appreciated
Do not use shellscript 2 but add the param to shellscript 1. Using 2 shellscripts makes it complex.
This question already has answers here:
How to run Node.js as a background process and never die?
(14 answers)
Closed 5 years ago.
I want to run this in background.
Here is the content of my .sh file.
Please suggest me
java -Dlogback.configurationFile=logback.xml -jar report-schedule.jar $1
You can use & at the end of your shell command,
sh YourScriptShell.sh &
Or you can also use Ctrl+z and then write bg
bg for background.
To retrieve it in foreground, use fg
And that's it :)
use
nohup your_shellscript &
This question already has answers here:
Running MATLAB function from Java
(5 answers)
Closed 7 years ago.
i have project in matlab (neural network) but my GUI is using java (netbeans) and i want to open my matlab project using that GUI. can anyone show me the code to open matlab or other program using java. thanks
You'd want something like this:
Runtime runTime = Runtime.getRuntime();
Process process = runTime.exec("matlab");
process.destroy(); // to kill the app
This question already has answers here:
Closing a Web Browser for a specific URL from the java program
(2 answers)
Closed 7 years ago.
I'd like to open an URL in the default browser using Java. So I am doing what the answer in this question says: Open a link in browser with java button?
It works. However, I want to automatically close that browser after some 10 seconds have passed (from Java). This is for Windows machines.
How can I achieve this?
Start the process with:
Process p = Runtime.getRuntime().exec(new String[] {"explorer", "http://google.pl"});
and after your 10 sec call:
p.destroy();
This question already has answers here:
Calling Python in Java?
(12 answers)
Closed 8 years ago.
I have a java web app where i need to use a simple web crawler to read html from webpages. I could not find any simple solution for this in java. But got a very simple python script that solve my problem. Now how to call that python script (.py) from my java class and also get the returned value from the python script .Thanks in advance .
First check out Calling Python in Java?
Another approach might be to call the python interpreter from the command line with a Java Process. See Java Process with Input/Output Stream and Call python script within java code (runtime.exec)