I am using the following code to execute a batch file:
java.lang.Runtime rt = java.lang.Runtime.getRuntime();
Process pr = rt.exec("MyBatch.bat");
My batch file takes some time to execute. I want my servlet process to wait ... |
I want to change modification timestamp of a binary file. What is the best way for doing this?
Would opening and closing the file be a good option? (I require a solution ... |
Is there any java library that is similar to unix's command file?
ie:
$ file somepicture.png
somepicture.png PNG image, 805 x 292, 8-bit/color RGB, non-interlaced
The file command is such a nice tool. I ... |
I am trying to use Java's Desktop / getDesktop() / open() call to open a text (simple ASCII) file with the system's default editor. I am using FileWriter / PrintWriter ... |
I want to to detect whether a given program can perform malicious operations like forking , interprocess piping , input/output redirection, file handling etc.
Actually I am developing a program that checks ... |
I'm executing an external command from Jython 2.1 by calling os.system(). This works, but I can't get to any error messages the external program is writing.
Jython 2.1 is too old ... |
i need to execute a .lnk file in java (lnk file that points at an exe file). how can i do?
in vb .net i do
Process.Start(path)
and it works
thx you for help.
... |
|
i need to perform some operations on files - rename, delete and etc.
what is better? use cmd commands or use java.io.File methods?
thanks.
|
I need to execute a .exe file from a function in one of the packages I have in my java project. now the working directory is the root directory of the ... |
when I run this command ffmpeg -i "C:\user\test.wmv" >C:\user\test.wmv_info.txt 2>&1 from command prompt it works but when I try to the same from java file by calling the command prompt it ... |
Nepomuk re: How can i open any file using voice command. Hi there! Voice recognition is an extremely complex field and years of effort and millions of dollars, euros and many ... |
|
|
Hi. How to exit from this java program which run on Unix. Help appreciate. Pierre here the complete code import java.io.*; public class RunCommand { public static void main(String args[]) { String s = null; try { // run the Unix "ps -ef" command Process p = Runtime.getRuntime().exec("ps -ef"); BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream())); //BufferedReader stdError = new BufferedReader(new // ... |
Hi All, I am customizing iPlanet's BillerXpert and within the packaged code is a call to Runtime.exec() to run a conversion program. When the code runs I get a 'java.io.IOException: Not enough space' message, but when I println the command, copy it from the log, and run it at the command line it works. Here is the code: Runtime run = ... |
|
|
java classname [arg1] [arg2] ... where argX contains non-english characters i am now trying to run java command with non-english characters as arguments. the args[] array i get from main() cannot show those characters (it just shows "???"). how can i change the charset of system.in to utf8 before the program gets into main() so that i can get those characters ... |
How do you capture UNIX commands that produce only output into a TextArea? Say, I want to display the results of the UNIX "df" or "who" command into the TextArea. I know that I would have to somehow take the results and input it into a Stream, convert the Stream into a String, and display the String in the TextArea. I ... |
Hi I want to run external commnad from my program. I have a utility which I use to find differences between two files. Its a console application and can be run from command line by >diff file1 file2 I want to call this from a java program. How can I do this. Thanks Avijit |
i am using this program to open a unix shell and read the output of the command .. but it prints all the output after the command finishes ..is there a way to print the output line by line as soon it appears not to wait to the whole command to finish thanks in advance |
|
hi, i m trying to execute a CVS command from a java environment. i m writing this code to create a user. for this i m executing this cvs command "cmd /c cvs passwd -r -a " after executing this cmd the command prompt will prompt for a pasword and then after entring the password i have to retype the ... |
Guys, I want to read a file that I give through the command prompt. I want to know how I can avoid blank spaces so that I can get to the file. For example, I have a file located at c:\Documents and settings\User\file.txt. I want to read the file.txt, but when I supply this as command line argument, due to the ... |
hi everyone . i am facing a strange problem basically i want to redirect output "JAVA MYCLASS" command to my specific file. Description : Actually i want to redirect the output of "JAVA MYCLASS" command. where the MYCLASS would be the name of the compiled class at specific location. i tried following but got no output import java.util.*; import java.io.*; class ... |
Hi all, I have a command-file that looks like that: @echo off set DIR=c:\programs\zld\zld_batch_controller set LIB=%DIR%/lib rem ================================ rem classpath rem ================================ set CP=%DIR% set CP=%CP%;%LIB%/zld_batch_controller.jar set CP=%CP%;%LIB%/zld_server_impl.jar set CP=%CP%;%LIB%/zld_server_interface.jar set CP=%CP%;%LIB%/log4j-1.2.9.jar set CP=%CP%;%LIB%/commons-logging.jar set CP=%CP%;%LIB%/commons-cli-1.0.jar set CP=%CP%;%LIB%/spring.jar set CP=%CP%;%LIB%/toplink.jar set CP=%CP%;%LIB%/classes12.jar set CP=%CP%;%LIB%/xstream.jar set CP=%CP%;%LIB%/xalan.jar set CP=%CP%;%LIB%/mx4j.jar set CP=%CP%;%LIB%/mx4j-tools.jar set CP=%CP%;%LIB%/xmlparserv2.jar set CP=%CP%;%LIB%/quartz-1.5.1.jar rem ================================ rem vm options rem ================================ ... |
|
|
Hi, I have developed an application in swings in which a user will schedule a command. So to make it user friendly the user will enter only the command, like the "del d:\exp.txt". I am successful in all other parts of the program but when i try to run the command from java i get the error. The code is below ... |
Hi, Please have a look at the following code import java.nio.file.Files; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.io.*; import static java.nio.file.StandardCopyOption.*; public class FileChooserCheck extends JFrame implements ActionListener { JFileChooser fileChooser; JButton open,save; JTextArea text; String str[]; public FileChooserCheck() { fileChooser = new JFileChooser(); open = new JButton("Open"); save = new JButton("Save"); text = new JTextArea(50,50); open.addActionListener(this); save.addActionListener(this); JPanel panel ... |
|
|
I have a java file with the main method in it and need to run the file using ms dos. These are the Enviroment Variables setting I have: CLASSPATH C:\Program Files\Java\j2re1.4.2_12\lib\ext\QTJava.zip QTJAVA C:\Program Files\Java\j2re1.4.2_12\lib\ext\QTJava.zip All my java code is in the D:\project\student folder Can any please advise me on how to run the java file using command prompt? Thanks, Zub |
HI, This is sekhar.I m facing a severe problem mentioned below. i have some macros in my ooDoc_w_makro.odt file.i have to start a particular macro from command promt . i have tried the following thing. C: Program Files OpenOffice.org 2.0\\program soffice.bin C:\\Test\\Makro ooDoc_w_makro.odt -invisible -headless -nofirststartwizard \"macro:///AnswerMsg()\""; AnswerMsg is my macro name to be started. but it is not opening the ... |
|
|
I am trying to build an online java compiler. I want to make an input redirection to a file. I try instead of reading values from the keyboard to read them from a file. When i use the |
Hi, I am trying to sort files (about 2 to 10 files, each will have about 2000 lines ) in java. I started initially by loading file contents to an array and sort that, to display in JTextArea, but when i select more then 2 files, i get Heap Space (Memory not available) because of loading everything to array. Can some ... |