How to use cvs checkout command in java

Hi,
I am using Ubuntu
I have installed cvs client in ubuntu
I have one problem running 'cvs checkout' command through java..
"cvs" -d ":ext:[email protected]:/var/cvs" co -P "Auto/test"
When i run the above command in terminal, i got one prompt like '[email protected]'s password:' in the terminal if i give the valid password the folder 'Auto' checked out successfully..
I have tried following steps but i don't know how to give the password to the terminal using java
First i created the 'checkout.sh' file.
In this i have typed "cvs" -d ":ext:[email protected]:/var/cvs" co -P "Auto/test"
Then i call it using java by the following code
=================================================================
String cmd[] = {"bash","checkout.sh"};
Runtime.getRuntime().exec(cmd).waitFor();
=================================================================
Anyone let me know how do I achieve this in java?
Thanks in Advance
Kulandaivelu

masijade. wrote:
PhHein wrote:
Maybe you need to modify your links to be more obvious :P
[*>>klick me<<*|http://www.jcvs.org/]
Nah! Attention to detail is one of most crucial attributes for a programmer in any language. ;-)
Edit: The urls seemingly don't like h1 and color tags. ;-)Nope, they don't and I couldn't be bothered to try.
Gratz on Gold!

Similar Messages

  • How to execute a shell command in java?

    here, my environment is redhat 7, jdk 1.5.
    i don't know how to use the shell command in java.
    i want to use this function:
    #include <stdlib.h>
    int system(const char * string);
    please give me some ideas. and Thank you so much if coming with a little demo.

    i know i should use JNI. because i have to use C lib.
    but i have already use JNI to wrapper the original code the cpp code and java code is :
    //: appendixb:UseObjImpl.cpp
    //# Tested with VC++ & BC++. Include path must
    //# be adjusted to find the JNI headers. See
    //# the makefile for this chapter (in the
    //# downloadable source code) for an example.
    #include <jni.h>
    #include <stdlib.h>
    extern "C" JNIEXPORT void JNICALL
    Java_UseObjects_changeObject(
    JNIEnv* env, jobject, jobject obj) {
    jclass cls = env->GetObjectClass(obj);
    jfieldID fid = env->GetFieldID(
    cls, "aValue", "I");
    jmethodID mid = env->GetMethodID(
    cls, "divByTwo", "()V");
    int value = env->GetIntField(obj, fid);
    printf("Native: %d\n", value);
    env->SetIntField(obj, fid, 6);
    env->CallVoidMethod(obj, mid);
    value = env->GetIntField(obj, fid);
    system("preprocess -path sha.c");
    printf("Native: %d\n", value);
    } ///:~
    //: appendixb:UseObjects.java
    // From 'Thinking in Java, 2nd ed.' by Bruce Eckel
    // www.BruceEckel.com. See copyright notice in CopyRight.txt.
    class MyJavaClass {
    public int aValue;
    public void divByTwo() { aValue /= 2; }
    public class UseObjects {
    private native void
    changeObject(MyJavaClass obj);
    static {
    // System.loadLibrary("UseObjImpl");
    // Linux hack, if you can't get your library
    // path set in your environment:
    System.load(
    "/root/jproj/UseObjImpl.so");
    public static void main(String[] args) {
    UseObjects app = new UseObjects();
    MyJavaClass anObj = new MyJavaClass();
    anObj.aValue = 2;
    app.changeObject(anObj);
    System.out.println("Java: " + anObj.aValue);
    } ///:~
    i modify this two file which is from TIJ-2edition.
    the output is
    Native: 2
    Native: 3
    Java: 3
    but what i want to be executed "preprocess -path sha.c" does not work.
    i have change the command to, such as "df", "ls" etc. but none of them works
    please help me.

  • How to use the TCP/IP in Java?Thanks!

    How to use the TCP/IP in Java?Thanks!

    Look at the java.net package, more specifically to classes ServerSocket (The server TPC conection) and Socket (the client TCP conection)
    Abraham

  • How to Use Windows XP theme in Java

    How to Use Windows XP theme in Java.
    I am an developing application which L&F should be like Windows XP.
    Because I am going use this application in different OS.
    Which LookAndFeel I have to use it

    try this in main:
    try {UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());}
    catch (Exception exc) {System.err.println("Eroare la incarcarea look & feel" + exc);}

  • How to use ls-l command in SAP ??

    Hi,
    can any one suggest how to use ls-l command of unix in sap to get the details of file like creation date,etc.
    Thanks.

    Hi Krishna.
    These are the steps you need to follow.
    tables: specify the table.
    data: begin of fs_...
            end of fs_    " Structure Field string.
    data: t_table like
            standard table
                      of fs_...
    data:
    w_file TYPE string.
    data:
      fname(10) VALUE '.\xyz.TXT'.
    select-options: if any.
    PARAMETERS:
      p_file LIKE rlgrap-filename.
    w_file = p_file.
    select .... statement
    OPEN DATASET fname FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    *OPEN DATASET fname FOR OUTPUT IN BINARY MODE.
    LOOP AT t_... INTO fs_....
    write:/ .....
    TRANSFER fs_... TO fname.
    or
    TRANSFER t_... TO fname
    ENDLOOP.
    CLOSE DATASET fname.
    Reward points wisely and if you are benefitted or ask for more detailed explanation if problem not solved.
    Regards Harsh.

  • How to use HTML Tags in webdynpro java

    Hi,
         Can any body tell me how to use HTML Tags in webdynpro java.
    If u provide me with sample code it will become more usefull.
    Thanks & Regards,
    SN

    HI,
    Please find the steps:
    Create a html file and store in your webdynpro project
    Add the html contents in your file
    & Create a IFRAME UI element and refer you html file
    Now you able to see the html in webdynpro
    Thanks & Regards,
    Ram

  • How to use CVS with JDeveloper

    Hi all!
    I'm starting a new project and I would like to know how to use CVS with JDeveloper. This is my first project where I will have two more people working with me and I don't know what the better approach is. Should I use CVS that come with JDeveloper (option Internal to Oracle JDeveloper 10g) or should I configure an external repository? In both cases, I don't know what I have to do to have CVS working properly with JDeveloper. Actually I tried to create a new CVS connection in CVS navigator (using the access method Password Server), but when I test I receive the message: Could not open connection to CVS server: general socket failure, sure I must doing something wrong.
    I'm using JDeveloper 10.1.3.0.4
    Thanks in advance.

    Thanks for you help John!
    I installed cvsnt and when I try to create a new CVS connection inside JDeveloper I receive the message: authorization failed: server adminf29786.dixamico.com.br rejected access to /Diversos/DownLoad/CVS/usr/local/cvsroot for user JMartins
    I using pserver method and JMartins is my user in windows
    There is something that I'm curious about, when I was installing CVSNT I didn't configure any user and password, is there any default user/password?
    Thanks!

  • How to use "Open Stream" command?

    How to use "Open Stream" command in the iTunes application.

    File > Open Stream > Enter a URL > Click OK > Listen. Obviously the URL needs be a valid media source like an mp3 file or a streaming radio station.
    tt2

  • How to use Operating System Commands while using define in sqlplus

    How to use Operating System Commands while using define in sqlplus . The Host OS is Linux
    define report_name=PROD_${host date "+%b"}.html
    The above is not working.
    The output should be 
    define report_name=PROD_JAN.html
    Regards,
    DB

    of course I was talking nonsense: the problem here is the mixing of bind variables and DEFINE variables.
    With the following changes the script should work (the conditions for begin_interval_time are perhaps not what you want):
    variable snap1 number
    variable snap2 number
    variable rptname varchar2(20)
    begin
    SELECT min(snap_id) into :snap1 FROM dba_hist_snapshot WHERE CAST(begin_interval_time AS DATE) >= SYSDATE-1;
    SELECT max(snap_id) into :snap2 FROM dba_hist_snapshot WHERE CAST(begin_interval_time AS DATE) >= SYSDATE-1;
    end;
    col file_name_value new_value report_name noprint
    select 'PROD_'|| to_char(sysdate,'MON') || '_' ||  to_char(sysdate,'DD') file_name_value  from dual;
    define  report_type  = 'html'
    define num_days=2
    define begin_snap=:snap1
    define end_snap=:snap2
    @@?/rdbms/admin/awrrpt.sql

  • How to use shell program parameters in java program??

    Hai all,
    I am writing a java program which must read strings from a file and must assign to variables.these strings are nothing but the output of ls -l command in shell. i need to have all those 9 fields in a file as variables.
    I cant find any method that will read only string.I came accross read line but that is not what i need.So, i thought of writing a shell script and by using awk, storing those 9 fields in 9 variables.. but how to use that variables in java programming???
    the shell script is executed by exec() but i need that variables also.
    Help me please:(
    thanks in advance

    i now changed the code... and closed the output file and then i read.Later i splited with the line i read.. but the same happened...
    this is the code:
    while ((l = inputStream.readLine()) != null)
                        op=new FileOutputStream("op.txt");//output of exec goes to this file
                        String[] cmd= {"/bin/sh","-c","ls -l "+l};
                        rt = Runtime.getRuntime();
                        proc = rt.exec(cmd);
                        // any error message?
                          StreamGobbler errorGobbler = new
                          StreamGobbler(proc.getErrorStream(), "ERR");
                        // any output?
                          StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "",op);
                        errorGobbler.start();
                               outputGobbler.start();
                        op.close();//the file is closed now
                        ip = new BufferedReader(new FileReader("op.txt"));     //now i opened to read
                        p=ip.readLine();
                        a=p.split("\\s");
                        ip.close();
                   }where i went wrong?

  • How to using the executable software in Java

    I got a software named: pdf to text convertor; which can format the text interface from the pdf, for example, you need add the page number with a4 paper, then the convertor can change the pdf into text with page numbers. it is running on the doc, the command like: c:\pdfconvertor\xpdfrc.exe "c:\filename\name.pdf", after the text file will exist in the same directory with the pdf file.
    so my problem is how to use java to call this DOS command to execute the program, and then java can read the text file, does some one give me some idea? better with simple java code!! Thanks very much! I will pay dollar for the solutions

    You can use:
    String[] cmd = {"c:\\pdfconvertor\\xpdfrc.exe", "c:\\filename\\name.pdf"};
    Process p = Runtime.getRuntime().exec(cmd);Wait for the process to finish:
    p.waitFor()and do your thing with the output file.
    Note there are mechanisms for capturing the input and output of the subprocess; see java.lang.Process javadoc.

  • How to use CVS to fetch the repository

    hello.
    I want to use cvs to fetch some codes from j3d.org.
    When I do "cvs -d CVSROOT=:pserver:anonymous@cvs.
    j3d.org:/home/cvs/j3d/cvsroot checkout code " in
    cvs directory, I get error message "connection refused".
    what's wrong ? could some one help me?

    Thank you.
    however, i still can't connect with server by trying your
    kind suggests.
    i have too little knowledger of cvs.
    i attach a document from j3d.org about downloading the codes. You may get the right way after read it ,i suppose.
    please pardon my boring.
    From j3d.org
    J3D.org CVS Information
    This entire site is managed using CVS. It is possible to download everything to your machine to keep up to date. Warning - it's big! As we don't provide a convenient zipped form of the site, this is the only way to fetch it.
    Software
    If you do not know what CVS is, or you know but don't have any software, then you should pay a visit to the CVS Homepage. CVS allows you to do incrememental updates of files as they become available, as well as rollbacks to earlier versions. Thus, the files that you download from CVS may not always be in a compilable state, but they'll be the latest copy, pretty much whatever the developers are working on at the moment.
    Downloading
    Anonymous cvs read access can be had by using the following CVSROOT setting:
    CVSROOT=:pserver:[email protected]:/home/cvs/j3d/cvsroot
    There is no password required. (ie hit enter when asked).
    Of course, you need to know what to download once you have logged in. Here is a list of all modules in the system. A few of them are definitely work in progress and not pretty. Buyer beware!
    Module Description
    code The j3d.org code repository
    code_website The code.j3d.org repository website
    faq The raw contents of the FAQ. Text and XML files
    faq_code Java code used to generate the FAQ
    ftp The raw contents of the FTP site
    scripts Various scripts used to maintain cvs and the site
    setup Raw files, templates etc to get working
    website The core pages of the main website (www.j3d.org)
    jobs The nacent, yet uncomplete jobs area
    ps. my os is Win98.
    Your more hints are very valued.

  • Please help How can i run Os commands thru Java programs

    Hey,
    I want to stop and restart the linux server thru java program.Is it possible to run the os commands thru java program.
    I had it thru Runtime.getRuntime().exec("*.exe");
    it only runs the exe files.How can run files other than exe files like .bat,com ans shell commands..Any body knows please help with the code..or mail to this address
    [email protected]
    thankyou,
    regards,
    j.mouli

    What about "start command.com /C execute.bat", or using the overload that takes a String[] as argument?
    What if you use the the full path of execute.bat?
    What error code do you get?
    And what comes th linux, I'm not sure... you'll need a shell interpreter there too, me thinks. (never had to run anything with runtime.exec on linux). Check the man pages if csh, bash, ksh, or what ever shell you like.

  • How to execute any cmd command from java application?

    Hi all,
    How to execute or call any command of cmd from java application??
    Is there any method to do so??
    Or, is it possible to do it using Runtime.exec() ??? And if so, how to use it, please explain with ab example...
    I'll highly appreciate....
    Thank you.

    If google would be the best option, then I would not be on Sun's forums and I would not have asked experts like you, sir !! :-)
    Neway, I got the solution from PhHein !!
    Good link indeed..
    Cheers..

  • How to Use COM Component in a Java Bean

    Dear Sir,
    How can I use a COM Component in a Java-Bean . I am having a COM Component for reading Weighment Reading on a Serial Port and want to use this Component in a Java-Bean . I would also like to call the methods of this COM Component inside my Java-Bean . COM Component is a dll file .
    Please guide me how to go ahead . If possible kindly provide some sample code for the same .
    With Thanks and Regards
    B V Mittal

    You need a Java to COM bridge like Jacob. Try searching this forum for more information, I've answered this question several times before.
    Dom.

Maybe you are looking for

  • Error in simple java code.

    Hi folks,    I am having some problem to compile this code, anybody can help me please ? Thanks a lot. Patricio. package Duck02; import java.util.List; import com.sapportals.portal.prt.component.*; import com.sapportals.wcm.repository.IResource; impo

  • Extracting object usage from SELECT

    I thought I had a great idea by using "explain plan" to extract the different objects (tables, views, synonyms, stored procedures etc.) that a given SELECT statement is using. However, after some fidling around I've realized that "explain plan" doesn

  • Break point in Planing Function

    Hi Everyone, A planing function is not getting executed properly. I wanted to check it by executing with trace. I am trying to do it by putting some print statement and execute with trace. Can some one provide syntax for print statement in planing fu

  • Leading zeros not reading in Barcode

    I am trying to get a number field to read in a barcode.  The field has leading zeros hard coded into the field to make it a uniform amount of digits. These zeros are not typed. The barcode will only read the information that is typed and will not rea

  • Error:Unresolved dependencies

    Hi, while installing patch for EP6 SP6.Im getting the error as in log file below. can anyone tell me how to fix this problem Dec 29, 2004 4:51:37 PM  Info: Starting SDM - Software Deployment Manager... Dec 29, 2004 4:51:44 PM  Info: tc/SL/SDM/SDM/sap