Re: how to execute a video in java?
Ol�
Estou a iniciar um projecto no Brasil no qual necessitarei de J2me developers, gostaria de saber se poder�s estar ou n�o interessado. Envia Curriculo para [email protected]
JavaWorld published an article about this topic. It is called "Java FTP client libraries reviewed" and it can be found here :
http://www.javaworld.com/javaworld/jw-04-2003/jw-0404-ftp.html
Best regards
Jean-Pierre Norguet
Jean-Pierre Norguet
JavaWorld Press
http://wasa.ulb.ac.be/jp.html
Similar Messages
-
How to execute Linux command from Java app.
Hi all,
Could anyone show me how to execute Linux command from Java app. For example, I have the need to execute the "ls" command from my Java app (which is running on the Linux machine), how should I write the codes?
Thanks a lot,You can use "built-in" shell commands, you just need to invoke the shell and tell it to run the command. See the -c switch in the man page for your shell. But, "ls" isn't built-in anyays.
If you use exec, you will want to set the directory with the dir argument to exec, or add it to the command or cmdarray. See the API for the variants of java.lang.Runtime.exec(). (If you're invoking it repeatedly, you can most likely modify a cmdarray more efficiently than having exec() decompose your command).
You will also definitely want to save the returned Process and read the output from it (possibly stderr too and get an exit status). See API for java.lang.Process. Here's an example
java.io.BufferedReader br =
new java.io.BufferedReader(new java.io.InputStreamReader(
Runtime.getRuntime().exec ("/sbin/ifconfig ppp0").
getInputStream()));
while ((s = br.readLine()) != null) {... -
How to execute external program in java?
My question is how to execute an external program in java.
I need to call a unix command in java.
Thanks.it depends on what you are trying to do. Following are the two methods
1. Runtime.exec() : this method allows you just to call an external program as a seperate process
2. JNI (Native Interface) :- As of right now only C and C++ are supported by this method. This method allows you to directly call the C/C++ methods from JAVA -
How to execute jar file in java project
hi,
i have made a proj in java in which i have put all my files in a jar file.
can somebody help me how to execute this jar file??
thanksu can put that jar file in ur class path,,
regards
shanu -
How to execute PL/SQL from Java?
I want to execute (compile) a PL/SQL file to a database and I don't know how it can be done with Java.
Please note that I am NOT trying to call a stored procedure. I know that can be done with CallableStatement.
Background:
My actual requirement is to execute PL/SQL files with error notifications. I tried Ant SQL task; but it fails to give compilation error information. I also tried another open source task called Incanto - that also not that helpful as if I execute in bulk, very hard to figureout which one throws error. Hence I decided to write my own Ant task.Hi,
do u want to execute PL/SQL files? or just you want to execute the block of code?
in the case of PL/SQL file:
you need to read total file as StringBuffer/String and then execute.
Block of code:
you can directly pass the code to the java file as input and then execute.
Ex:
StringBuffer queryString = new StringBuffer();
queryString = queryString.append("BEGIN execute immediate ' ");
queryString = queryString.append(query);
//queryString = queryString.append("BEGIN dbms_job.run(142);END;");
queryString = queryString.append(" '; END; ");
final_Query = queryString.toString();
try {
System.out.println("final : "+final_Query);
cstmt = con.prepareCall(final_Query);
System.out.println("Job is Running...");
new ThreadCountdownExtThread().start();
System.out.println("bfore execute()...............");
cstmt.execute();Note: if you are running pl/sql file read file and save it in a Stirng , and then do the same as above stated -
How to execute another application from java ?
I want to execute another application ( not java ) from my java application. Is it possible ? How can we do it ? Please guide me...
thanxHi littlestuart,
Yes it's possible.
Your question is frequently asked, please search the forum or google for an answer.
/Kaj -
How to execute dos command in Java program?
In Perl, it has System(command) to call dos command.
Does java have this thing?
or any other way to execute dos command in java program?
Because i must call javacto compile a file when the user inputed a java file name.Look in the Runtime class, it is implemented using the Singleton design pattern so you have to use the static method getRuntime to get its only instance, on that instance you can invoke methods like
exec(String command) that will execute that command in a dos shell.
Regards,
Gerrit. -
How to execute .bat file through java?
I already create a batch file to pull & push file. Now, i want to execute this .bat file java.I got this example but it doesnt work. Did i missed something or do we have the better one?
import java.lang.*;
import java.io.*;
public class Loadfile
public static void main(String args[]) throws IOException
Runtime load = Runtime.getRuntime();
r.exec("C:\\pull.bat");
}For Runtime,i'd change it to:
Runtime load = Runtime.getRuntime();
String cmd = "C:\\javaclass\\copytemp.bat";
Process proc = load.exec(cmd.toString());Is it right? But still can't work.
Here is the .bat file:
@echo off
c:
cd "c:\Inetpub\ftproot\Debitin"
C:\Inetpub\ftproot\Logrecord\pullscript.txt echo open localhost
C:\Inetpub\ftproot\Logrecord\pullscript.txt echo Administrator
C:\Inetpub\ftproot\Logrecord\pullscript.txt echo password
C:\Inetpub\ftproot\Logrecord\pullscript.txt echo cd ftpScript
C:\Inetpub\ftproot\Logrecord\pullscript.txt echo binary
C:\Inetpub\ftproot\Logrecord\pullscript.txt echo lcd C:\
C:\Inetpub\ftproot\Logrecord\pullscript.txt echo lcd "C:\Inetpub\ftproot\infile"
C:\Inetpub\ftproot\Logrecord\pullscript.txt echo prompt n
pause
C:\Inetpub\ftproot\Logrecord\pullscript.txt echo mget *.txt::@rem >> C:\Inetpub\ftproot\Logrecord\pullscript.txt echo mdel *.*
C:\Inetpub\ftproot\Logrecord\pullscript.txt echo byeftp.exe -s:C:\Inetpub\ftproot\Logrecord\pullscript.txt
::del C:\Inetpub\ftproot\Logrecord\pullscript.txt
pause
exit
[\code] -
How to execute ".exe" files using java
Hi,
This is guruvulu,
I have a problem in executing ".exe" files.For Example InternetExplorer.Hi,
You can execute .exe files in JAVA using the following code.
Runtime rt1 = Runtime.getRuntime();
Process pc = rt1.exec("someexe.exe");
you can get the output of the executed exe file in
in = pc.getInputStream(); //this returns a InputStream
hope this solves your problem.
regards,
P.Venkat -
�How to execute a .exe from Java applicattion?
Hi, I have to play a file song with VLC(Video Lane Client) from a Java applicattion. I know how to open an external executable, but not how to open some file with it. Thanks
I don't understand very well. It is new for me.The documentation for VLC will show you what command-line options there are for controlling the player. You can use these similarly to how you would launch an executable, since you will in fact be launching an executable. Later versions of VLC also give you a telnet interface, so you can remotely control the player via a telnet connection. Combine that with some socket programming or something like apache-commons-net TelnetClient, and you can do what you're after
I can't really help much more than that, because I can't remember what the commandline options are or anything, only that they exist! -
How to execute DOS command in Java?
I want to execute a dos command in Java,such as execute test.bat command? How to realize it?
Thanks in advance!http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
I found this article really useful in solving this. Hope it helps.
Cheers,
John -
hi friends,Iam used mysqldump command in linux platform to take backup of the database,its work properly....the command am used is
mysqldump -u root -p threadpool > sampledatabase.sql
I need to execute the same command in java....?Anyone here to know how to do that....?Thanks in advance........Crosspost:
http://forum.java.sun.com/thread.jspa?threadID=5185230&messageID=9721722#9721722
http://forum.java.sun.com/thread.jspa?threadID=5185199&messageID=9721587#9721587
Do not mess the forum. -
How to execute .msi files from java program
Hi friends,
i have written a java program which invokes and thereby execute any executable files like .exe and .bat.
So its working fine with .exe and .bat files, but it is not working with .msi files.......can you please help me how can i execute .msi files as well??
public class Executeexe {
public static void main(String ar[])
try
Process p=null;
Runtime rt=Runtime.getRuntime();
p=rt.exec("D:\\mysql-essential-5.0.83-win32.msi");
p.waitFor();
catch(Exception e)
}here is the programMake sure that the command that's being exec'd works from the cmd line.
Then read this article and do what it says:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
Then if you still are having problems explain what "...it is not working with .msi files..." really means, and provide a [SSCCE Example program|http://mindprod.com/jgloss/sscce.html] -
How to execute command line by Java
Hi all,
I have the following DOS command line that I need to execute it through Java:
C:\Documents and Settings\Mxmler\Desktop\bin>vr1tovr2 Box.wrl -o Box2.wrl
I know that I have to use Runtime.getRuntime().exec, But can anyone show me how to use it for the above?
ThanksMxmler wrote:
I need your help please
Forget about the first thread
vr1tovr2 located inside a sub directory called converted (not in the main directory of the project constructed by eclipse)You have to tell the system where to find the program you're trying to run. You can specify the full path to the executable. Alternatively, you can specify the PATH environment variable when you call exec() (and I presume there's something similar for java.lang.ProcessBuilder). Read the docs.
Box.wrl & Box2.wrl (will be generated) both of them are located in another directory called usrYou can either specify full paths to those files, or you can set the current working directory when you call exec(). So you'd tell exec() that you're in the directory where those files are. Read the docs.
I have tried to do the following and I got the following error message: CreateProcess error=2, The system cannot find the file specifiedYou need to do what I said above, in particular, the first one (where you tell the system where to find the program you're trying to run).
String path = System.getProperty("user.dir");
String userFolder = "usr";
String fileName = "mxmler";
String extension = ".wrl";
Runtime.getRuntime().exec("vr1tovr2 "
+ Key.QUOTE
+ path
+ Key.FORWARD_SLASH
+ userFolder
+ Key.FORWARD_SLASH
+ fileName + extension
+ Key.QUOTE
+ " -o "
+ Key.QUOTE
+ path
+ Key.FORWARD_SLASH
+ userFolder
+ Key.FORWARD_SLASH
+ fileName + "v2" + extension
+ Key.QUOTE);If you're going to break it down like that, then don't use the version of exec() that takes a single String for the whole command line. Use the version of exec() that takes an array of Strings (the first String in the array is the program to run, and the remaining strings in the array are arguments to that program). -
How to stream audio / video in java?
Hello.
I would live to develop a java application (JavaEE, with tomcat or JBoss) that could stream audio / video over the Internet, on a controlled matter.
First, I would have to embed a flash player, correct? Need suggestions on one, paied or free.
My questions are: How can I have the flash player stream audio to users by downloading it from a java app server, if the user has a session and is logged in, etc? (picture myspace here)
Also, how do I measure network traffic in Java? (The flash player of each user will stream the songs, I'd like to know how much bandwith is going around).
The reason that I'm asking this here is because I have no idea of which forum to ask this.
I have been a Java app developper for the past five years, so coding won't be a problem, I just don't know which API / Frameworks to turn to.
Thanks for all your help.
Regard,
Carlos.ragedd wrote:
First, I would have to embed a flash player, correct?No. You're just taking ideas from other popular streaming sites. It's certainly not a requirement.
My questions are: How can I have the flash player stream audio to users by downloading it from a java app server, if the user has a session and is logged in, etc? (picture myspace here)The same way you would authenticate any website. Usually a database and a challenge/response. If they're not logged in, then instead of writing out the content, write out a 403 status code (or do something more graceful, such as redirect them to the login page).
Also, how do I measure network traffic in Java? (The flash player of each user will stream the songs, I'd like to know how much bandwith is going around).Just keep track of how much data you send to the OutputStream.
Maybe you are looking for
-
I have FF ver. 5 and for about a week now it is taking way longer than normal to load any and all pages. My OS is Windows 7 & I'm on a dual core processor computer that runs each processor at 3.40 GHz. I can't play any of my games because of how slow
-
Error while applying the R12.PJ_PF.B.DELTA.5
Hi, The patch session failed when it was running pablu.ldt FAILED: file pablu.ldt on worker 1 for product pa username APPS. FAILED: file b9281321lu.ldt on worker 2 for product pn username APPS And the log /ebs/DEV/app/apps/apps_st/appl/admin/DEV/log/
-
Opening a WEB page from FORMS CS & WebForms
Hi, We would like to open a Web Page from a forms running in client/server as well as from a form runningover the web. Over the web, we plan to use SHOW_DOWUMENT (Even tough it seems broken, on forms 6.0, the only way we have got it working was by us
-
hi! i want information about tables n their columns for perticular database. i m using getcolums(String catlog,String schemapattern,String tablenamepattern,String columnnamepattern) method in DatabaseMetaData.I m using sql server 2000 as my db n i wa
-
How to select multiple nodes, which are not next to each other, in a tree?
The following code suppose to allow user select any combination of nodes (because of DISCONTIGUOUS_TREE_SELECTION), however, I can only select nodes which are next to each other. Can some one told me how to make this DISCONTIGUOUS_TREE_SELECTION work