Do scp from my java application
Hi,
I don't know if I in the right place, but I didn't find other forum.
I tried to use the method: Runtime.getRuntime().exec("scp -i the path of my publickey on the remote server usernameOnTheRemoteServer@remoteIP:path of the file that I want to copy myComputerPath)
and I got exception: Cannot run program "scp": CreateProcess error=2, The system cannot find the file specified
can someone help me??
thnx.
How about the general java programming forum?
Most likely you need to make the command prompt / bash invoke that command in stead of invoking it directly. This article will teach you everything you need to know about runtime.exec(); read it well:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
Similar Messages
-
How can i call a jasper report from a java Application
Hi,
i am chiranjit , currently i working in a web based ERP project, in this project as a report building tool we are using JasperReport wih eclipse plugin . in eclipse report's are generating very well but i am unable to call that report from a java application because i have no idea about the How to call a Jasper Report from a Java Application . so please send me the necessary class names, jar files names and programe code as early as possible.
ChiranjitAhh, kind of a duplicate thread:
http://forums.java.sun.com/thread.jspa?threadID=631642
@OP. You could have clarified your original post and the relationship of your question to java. You did not need a new thread.
� {� -
How can i call a VB6 project from my java application using JNI
hi
can anyone tell me the procedure of calling a VB6 project from any java application using JNI
if anyone does know then tell me the detail procedure of doing that. I know that i have to create a dll of that VB6 project then to call it from the java application.
if anyone know that procedure of creating dll file of an existing VB6 project please reply
please if anyone know then let me knowAhh, kind of a duplicate thread:
http://forums.java.sun.com/thread.jspa?threadID=631642
@OP. You could have clarified your original post and the relationship of your question to java. You did not need a new thread.
� {� -
Calling a web service from a Java application
Does anyone have sample code showing how to call a web service over from a Java application? I'm deploy to HP-UX and seeking out the most standard and reliable approach.
Thank you in advance.Keith,
Download JWSDP 1.2, look at the tutorial for JAXRPC, especially
the client portion. -
How do i Hyperlink to a web page from a java application?
How do i Hyperlink to a web page from a java application using internet explorer as my default web browser?
It's very simple.You can start any Application with the class Runtime. The command is an array consisting of the path of .exe and the file to be open.
String [] cmd={path of IE+Filename.exe,"URL of your website"}
try
Runtime.getRuntime().exec(cmd);
catch (Exception e)
System.err.println(e.toString());
} -
How to call pdf forms developed in ABAP from WD Java application?
Hi
I have a web dynpro ABAP application that that is responsible for generating PDF forms for all other applications (WD ABAP and WD Java).
How can I call the pdf forms generated by the WD ABAP application from WD Java application in a separate window?
These forms are to be called on click of a "Print" button. Also, these forms are non interactive.
Kindly let me know if you need any other information.
Regards
Vineet Vikram
Edited by: vineet vikram on Jun 24, 2009 7:28 AMin addtion to Nikhil's response. you can write following code on action of print button:
IWDWindow window = wdComponentAPI.
getWindowManager().createExternalWindow(
"<ABAP Application URL>",
"<Title for window>",
false);
window.open();
to Close the application, you can use the window close or u can fire an event to close current window.
Abhinav -
Control browser properties from a java application while launching a browse
How to control the properties of a browser when it is launched from a java application?
I am using the command " Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler "+url); " to launch the browser. The syntax of "exec" command is "public Process exec(String command,String[] envp) throws IOException". I would like to know whether we can give the arguments in this command to control the browser properties.
If you know any other option by which we can open a URL in a controlled browser, please share it.
Thanks in advance :).
Surekha_VenugopalHi All,
I have found a solution to control browser parameters from Java applications.
1. Create an intermediate HTML file at runtime which contains Javascript to launch a browser. Pass the parameters like the URL and browser control parameters to the Javascript of this HTML file.
2. Open this HTML file and invoke the javascript while loading the file. Javascript will launch the required URL in a controlled browser.
3. Close the intermediate HTML file.
Limitation:
1. There will be a flickering of windows.
2. Applets will have permission issues with the above solution. For applets a better solution is JSobject. No need of an intermediate file here.
Hope this will be useful for someone. :-)
Cheers,
Surekha_Venugopal -
Example-- Call RFC from external Java Application
Update: I need code example to call RFC from External Java application. Can onybody help me?
RGDS
RP
hi all.
i want to create my own log for each interface.
i saw this blog:
/people/michal.krawczyk2/blog/2006/09/20/xi-abap-mapping-logs--more-standard-better-visibility
my doubt is how to catch the error that i see in SXI_MONITOR y put it in a Sub-Objetc.
For example: in sxi_monitor i get the error for my interface NMUCustomer: "No receiver could not be found" or "Error Mapping Traformation".
I created an Object called ZNMUCUSTOMER and a Sub-Objetc called ZERROR.
what i must do to get the error I see in monitor and assign it to Sub-Object??
Rgds.
Message was edited by:
Rodrigo Pertierra
Message was edited by:
Rodrigo Pertierra
Message was edited by:
Rodrigo PertierraHi,
Oh, you are using ABAP mapping ......
then use the following in ABAP mapping ..
TRACE1,TRACE2,TRACE3.... for trace level 1,2,3......
http://help.sap.com/saphelp_nw04/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/content.htm
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/866ce290-0201-0010-338f-b8c3553aaa0f
Regards
Chilla -
How can access MS Outlook Calender information from my Java application.
People schedule meeting with some data on regular basis.
I need to access the Exchange server from my Java application and get the meeting dates along with other data pertaining to meeting.I had the same problem, and I dont think (as far as my knowledge goes) there is any freeware that will enable Java to access Exchange server. But there are some commercial products that are available.
Chk this link as an example: http://www.compoze.com/products_hme_desc.html
good luck in the research
-kms -
Can we control the top level navigation in portal from a java application
Hello,
I am having a scenario where User logged in to portal and assigned with 2 roles (HOME , ISA(Java application)). When user opened a form in ISA (Java application) and tried to enter the data in form and moved to another tab (e.g. HOME) in top level navigation.
When user come back to ISA (Java application) TAB , we show the page where he left earlier. I would like to know if user click any other TAB in top level navigation (Role assigned to him) while working on a page in ISA(Java application) is there any way we can catch that event before he leaves from ISA (Java application JSP page) to other TAB?
How can we control the top level navigation events in the portal from a java application .Since Top level navigation is seperate par file.
Thanks,
RNDear Rajesh,
Top Level and detailed navigation values comes with iteration in the respective par file.
Please check the par file and based on the value (i.e tab name) selected, you can write your code.
Best Regards
Arun Jaiswal -
Is it possible to create triggers in sybase from jdbc (java application)?
We are in the need to create a triggers in the database (sybase) from JDBC (java application)?
Please send me pointers or articles related to this.
Thanks in advance,
KriA trigger is NEVER explicitly called, from any environment.
It is implicitly called when you invoke the operation that it's a trigger for.
Whether you're using Java or anything else to invoke that operation makes no difference whatsoever. -
Running a dos command from a java application
hello,
I'm trying to execute a batch file from a java application. I tried with:
try
Process proc=Runtime.getRuntime().exec("fop -fo "+iXmlFoFile+" -
svg "+SvgFileName);
}catch (IOException e){System.err.println("Error in conversion of
the Xml FO file into Svg file: "+e);}
and with:
try
Process proc=Runtime.getRuntime().exec("cmd ./c fop
-fo "+iXmlFoFile+" -svg "+SvgFileName);
}catch (IOException e){System.err.println("Error in conversion of
the Xml FO file into Svg file: "+e);}
but i have a IOException: CreateProcess: .... error=2
When I try these line to launch a .exe file it works but not with a .bat file.
I also tried:
String execstr = "fop -fo "+iXmlFoFile+" -svg "+SvgFileName;
String [] commandArray = { execstr };
try {
Runtime.getRuntime().exec(commandArray);
} // end try
catch ( Exception e ) {
System.out.println( e.getMessage() );
e.printStackTrace();
}// end catch
but i got the same exception in java.lang.Win32Process.create
What did i do wrong?Your execution string is a bit more that I want to figure out, but here are a couple ideas:
Is the working directory of any importance? If so you'll need to set that when you do your exec()
I think I remember reading something about batch files that couldn't be kicked off via this method. Perhaps you need to execute the string "start mybatchfile.bat". Seems like you need to do something like that to get a command interpreter to run your batch file. -
Starting weblogic server from a java application
Hello,
I am trying to start the weblogic server from a java application i wrote.
the code:
Process p=null;
try{
p= Runtime.getRuntime().exec("cmd /c c:/startWeblogic.cmd");
catch (Exception e)\[
this doesn't start the weblogic... Using the same line to start other types of files does work... only file with the extention of cmd i can't run.
I even tried to write a bat file that calls the cmd file but it still does't work.
Can someone help?
THANKS!!!
P.S.
The Java application I used implement the SysTrayMenuListner - can this be the problem?no - nothing happened. it perform the next java code - and there is nothing else happen on the windows.
maybe i don't check in the right place for the error you are talking about?
i also tried i simple cmd file that does nothing - but still nothing...
for any other file types it works properly. -
Manipulate Indesign cliente from a Java Application
Hello, I need to manipulate Indesign client(open/close documents, create menus, tables, set colors etc... ) but I need to do that from a Java application. Is it possible? I was searching on google about it, even in Adobe's site, but the only way I found was thought Javascript, VbScript or AppleScript.
Thanks in advance!
RafaelI can control inDesign from Python or shell scripts on osx via `osascript` This is roughly how it works.
My 'master' program runs shell command `osascript -e "tell Indesign blahblah end tell" /path/to/temporary.jsx`
`osascript` tells Indesign to execute "/path/to/temporary.jsx" as javascript
If all goes well, the value of last expression in .jsx is returned by `osascript` (serialised JSON works great for this)
Sorry I'm vague on real life code, but this is my home machine so it's not in my reach.
I realise it's an ugly hack. Main cons follow:
quotes have to be escaped couple of times so the result is messy and prone to errors (luckily it's one-off code that sits hidden behind main interface)
debugging this chain is nightmare (especially with my nigh-zero knowledge of applescript)
so far it's mac only (I suspect same thing can be achieved on Windows machine with VBS)
one cannot avoid writing lots of temporary files to the system. (luckily for me, it's only deployed on machines under my control, so the temp files are written to /tmp which is mounted on ramdisk)
The only pro I can think of is that it works. Whole comlexicity is wrapped in one python module, which I only see when squashing the bugs.
Marcel -
Launching TextEdit on a Mac from a Java application
I am having a problem launching textedit from a Java application. It was working a week ago on a fresh iMac, but since then I have installed Lightroom, Photoshop, the Studio MX suite stuff, and now the textedit program does not start from my Java app. This is the code that I am using in my application to launch textedit:
String command = "open -e \""+filename.getAbsolutePath()+"\"";
Runtime rt = Runtime.getRuntime();
rt.exec(command);I've also tried it this way:
String command = "open -e \""+filename.getAbsolutePath()+"\"";
Process child = Runtime.getRuntime ().exec (command);I've printed the command to execute out on the console and it appeared like this:
open -ef "\Users\user\Desktop\filename.txt"But it doesn't open textedit. The funny thing is, if I copy and paste that open command into the Terminal, it will open the file in TextEdit. Why won't it work in my Java app anymore, but still work through the terminal? I don't get any errors in the console, it just doesn't open TextEdit anymore. Is there a setting somewhere that might have been changed that let me start TextEdit from a Java app. I checked and TextEdit is still my default program for opening text files, which I guess makes since why it works from the Terminal, but I don't get why it doesn't start TextEdit from my Java app.
Some of this might just be a Mac issue, I'm new to that system. But the code I'm using used to work. I guess maybe I'm looking for another (better) way of opening TextEdit on the Mac from Java.
I'm using Java 1.5.0_07. Thanks.Try specifying an absolute path for open (/usr/bin/open ?).
Maybe you are looking for
-
I have just upgraded to Mountain Lion from Lion on two laptops. Previously, in Lion, Microsoft Office had two folders in Launchpad - one called "Microsoft (Main)" and the other called, if I recall correctly, "Microsoft (Others)". Now, in Mountain Lio
-
AirPlay icon just won't appear on iTunes - i've done everything!
I've just gotten a gen3 Apple TV. Have been trying to get it hooked up to my iPhone 5 and my MacBook Pro. I'm running the latest software on both devices. My photostream will appear on the Apple TV and so will my purchsed music but I can't get AirPla
-
Max number of files that can be opened in harddrive through AEBS?
What is the maximum number of files that can be opened in a external hard drive (Lacie 500 GB, USB 2.0) connected through the AEBS? Looks like there is a limit. When I am trying to 'seed' files through a bit-torrent client (Azureus 2.5.0.4) many of t
-
Is there any spyware out there for the mac?
Been looking at spyware to monitor teenager's activities on the iphone 5. Seems they all want Jailbreak installed, but I understand that ruins the warranty on the phone. I don't want to do that, or anything illegal. But, we do need to monitor his act
-
Questions on pipe channel and e-mail processing
Hi There, We currently have a sendmail (on Solaris) based system that we use for our primary MTA. Our iMS5.2 (on Solaris 8) is used for message storage. We will want to migrate our sendmail system to the Iplanet MTA. However, I need some ideas on how