How to run a server program in the background on Linux or Windows?

I just finished writing a Java network application with multiple clients and one server.
However, I am not sure how I can run the server (SomeServer.class) in the background on Windows. Also when I am running it on Linux, I don't want it to terminate when I logout of the Linux shell.
To run the server on Linux, should I use a command like this?
nohup java -cp . SomeServer.class > output.txt &
Or is there another command, or perhaps some code that I can add to the program so that it would run in the background automatically and/or continues even when I logout of the Linux shell??
Sometimes, I also like to run the program on a Windows XP machine for testing purpose. How can I do it so that it runs in the background without openning a Console/Command Prompt window??
(redirecting the standard output to a file)
And is there an easy way to create a EXE file that runs the program with the default JRE in windows?

On many UNIX systems there's a utility called detach which will launch the following command in such a manner that killing the shell will not kill the process. On systems that lack this command, I'd find an open source implementation and install it.

Similar Messages

  • How to run a Concurrent Program from the back end?

    Hi,
    How to run a Concurrent Program from the back end?
    Is it Possible to see that Concuurent Request id which we run from the back end, in the front end?
    If yes, then Please Give reply how to write the code
    Thanks in Advance,
    Bharathi.S

    This is documented in Chapter 20 of the Application Developers Guide http://download.oracle.com/docs/cd/B53825_03/current/acrobat/121devg.pdf. These MOS Docs also have some information available
    221542.1 - Sample Code for FND_SUBMIT and FND_REQUEST API's
    235359.1 - How to Launch Planning Data Pull MSCPDP using FND_REQUEST.SUBMIT_REQUEST
    HTH
    Srini

  • How to run a Java program without the command line.

    Is there anyway to create a Java program that runs like most programs do in Windows ,by double clicking on their icons?
    Thanks,
    Vance

    http://www.ej-technologies.com/products/exe4j/overview.html
    Looks kinda cool. Most java-2-exe programs are usually way too expensive and wont work with GUIs and require other dlls/libraries...

  • Running a java program in the background

    I'm designing a network remote control system in java.
    I was wondering does anyone know if it is possible to run an application at the log in screen in windows 2000. There is no GUI and no command prompt.
    paddy

    If you mean can you run it as a windows 2000 service so the user doesn't see it yes you can.
    I recommend the following Java Service wrapper program:
    http://www.eworksmart.com/JNT/
    It's quite simple to set up and will start when the user logs in (so long as the service is set to start automatically).
    Hope that helps,
    Seigers.

  • How to run a JRockit process in the background(Linux ia64)

    Hello,
    I am trying to start a JRockit process 1.4.2 (with a Java app) from an SSH console and make it keep running after I log out. This is on Redhat Enterprise Linux WS 4 with Itanium II processor (ia64).
    The obvious thing such as
    java <options> <class> &
    or even
    nohup java <options> <class> &
    Do not work and the process terminates when I log out.
    Is there a recommended method or a facility to run JRockit in the background as a service/daemon? Does JRockit has switch similar to –Xrs of Sun’s JVM?
    Starting the process on system boot and having to reboot the system to restart it are not acceptable.
    Any help will be greatly appreciated.
    Thanks,
    Zapta

    Zapta did get an answer. You may have missed it if you're using nntp to access the forums, since many newsreaders don't track threads that change the subject. I recommende the using the web UI at dev2dev.bea.com.
    Anyway - Use "-Xnohup" with older versions of JRockit. In recent JRockit versions, "-Xrs" works as well, since we seen problems with people hardcoding that flag into various applications launchers (Tomcat for one).
    Cheers!

  • How to run a java program in the JVM of an already running program?

    As far as I know about JVM, each time we run a program a separate instance of JVM is created where the program runs. Correct me if I am wrong.
    Is there any way for another program to execute itself in the same JVM?
    Currently I am working on JFCUnit which is a tool used to automate swing applications. I am trying to automate JConsole.
    If I open "JConsole.exe" through a program and then try to get the handles using JFCUnit, things are not working.
    If I use JConsole.jar in JDK/lib and create a new instance of JConsole and then try to get the handles using JFCUnit, I am able to proceed with automation.
    But here comes the problem :-
    The application which needs to be automated through JConsole requires it to be started with few arguments, which is as follows:
    %JDK_HOME%\bin\jconsole -J-Djava.class.path=%CLASSPATH% -J-Dcom.sun.management.jmxremote.ssl=false -J-Dcom.sun.management.jmxremote.authenticate=true -J-Djmx.remote.protocol.provider.pkgs=oracle.oc4j.admin.jmx.remote "service:jmx:rmi://localhost:23791"So this problem can be solved in two ways,
    Either
    1. JFCunit could be made to recognize the JConsole.exe which would be running is a different JVM.
    OR
    2. JConsole.jar to be used in a way so that it takes the required arguments, hereby an instance of JConsole would be created that too in the same JVM as that of the program.
    I am more interested in the first solution as it would definitely be helpful in other projects as well.
    Please let me know if any other solution is possible.
    Any kinda solution is appreciated :)
    Thanks in advance.

    Give a look at Terracota.
    http://www.terracottatech.com/

  • HT201365 How do I stop the running of programs in the background?  The old way of doing it doesn't work now.

    How do I stop the running of programs in the background?  The old way of doing it doesn't work now.

    How to Close Apps
    Double Tap the Home Button... Then swipe the App (not the icon) Upwards... Tap the Home Button when finished.
    From Here  >  http://support.apple.com/kb/HT4211

  • Does anyone know How to run twin monitors on a MacBook Pro operating on a Windows Server 2008 R2 ?

    Hi
    Does anyone know How to run twin monitors on a MacBook Pro operating on a Windows Server 2008 R2 ?

    I know this doesn't help you much, but, I think you have to see if your Mac pro does audio out via HDMI. I don't even know if mine does via DVI. I think it may have to do with the adapter. Try going into Audio MIDI and setting the digital out to multichannel
    and using the toslink cable for now. Lemme see...apparently DVI does not carry audio at all. Hm. apparently monoprice could be helpful?  If I understand what you're saying correctly: you want to take DVI and multichannel audio via the Toslink and have it all go out over HDMI, right? Whooo..... amazon...looks like it's about $100http://www.amazon.com/Audio-SPDIF-Toslink-Converter-Adapter/dp/B0015YYOQQ
    just a shot in the dark
    I'm probably wrong....or not
    John B

  • How to run automatic payment program business area wise

    dear all
    please let me know how to run automtic payment program business area wise.
    for example business area 2020 we want to make payment business area wise.
    what are the back gorund settings for congigration Tc- fbzp
    wht are the configrations forTC- f110
    regards
    babu

    Hi,
    You can make payments business area wise if you had ticked payment goup business area wise in the payment method in company code screen. However you will have to give company codes in the payment parametets, but payments will be grouped by business area.
    Thanks,
    Ramesh.

  • How to run a ABAP Program in Batch JOB

    How to run a ABAP Program in Batch JOB ?

    Hello Manish,
    Using transaction SM36 you can define the batch job along with the start conditions for that job.
    1. Transaction SM36.
    2. Give the Z name of the job in the 'Job Name' input field.
    3. Click on 'Steps' button from the application toolbar.
    4. On the 'Create Step 1' dialog box, give the name of the ABAP program in the 'ABAP Program' section' along with the variant.
    5. Click on 'Check Input' button from the dialog box.
    6. Click on 'Save' button from the dialog box once the check is successful.
    7. One list will be shown. Click on Back button from the standard toolbar.
    8. Click on 'Start Conditions' button from the application toolbar. Specify the start condition e.g. immediate. Click on save.
    9. The job staus is now scheduled.
    10.Click on Save button from the standard toolbar of SM36. The job status will be released.
    Using SM37 you can monitor the status of the job.
    This will sort out your problem.
    PS If the answer solves your query, plz reward points.
    Regards

  • How to run a java program in another folder

    Hello!
    I want to run for example the java class file in the path ./sourcecode/javafile.class. It works fine if I do the following:
    cd sourcecode
    java javafile
    but it cannot work if I do:
    java sourcecode/java
    The error it outputs is NoClassDefFoundError.
    Can someone tell me how to run a java program in another folder
    thanks a lot.

    You need to specify the classpath using the -cp flag when running. so instead of
    "java sourcecode/javafile"
    Try
    "java -cp sourcecode javafile"

  • How to run report server in oracle 9i DS

    hi..
    can any 1 tell me how to run report server in oracle 9i DS
    i've installed oracle 9i DS, but don't know how to run
    report server.
    actually i want to run a report from my form
    on button press trigger.. some of the experts r tellin
    that 1st u check whether report server is running or not..
    so pls tell me how to install report server.
    while installing oracle 9i DS, i've given Mail server
    as mysmtp.com
    Thanks
    amit

    hi ..
    i've to go in this directory n run
    rwserver -install repservername
    where repserver name is my mailserver..
    this will install reports server
    Amit

  • Telnet on port 7 says connection refused, how to run echo server

    where do I need to look at echo server configuration.
    how to run echo server on solaris 10 X86.

    I got the answer -- svcadm

  • How to let sql server 2008 know the table created at front end in c#

    How to let sql server 2008 know the table created at front end in c#

    The best solution is to create table type and pass the DataTable as table-valued parameter. I have an article on my web site about this:
    http://www.sommarskog.se/arrays-in-sql-2008.html
    The full article is a bit of overkill for what you are doing right now, but just the few first pages should get you going.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Running program in the background

    Hi everybody!
    I need to run  program in the background.
    So I need only to change the sy-batch status to 'X'?

    HI,
    if your program is runninn in the Background then the System field SY-BATCH will become 'X' otherwise it will have space ......
    it will not execute the job in the background if you put SY-BATCH = 'X'
    you need to use: Job_open , Job_submit and job_close function modules
    example:
    *Submit report as job(i.e. in background) 
    data: jobname like tbtcjob-jobname value
                                 ' TRANSFER TRANSLATION'.
    data: jobcount like tbtcjob-jobcount,
          host like msxxlist-host.
    data: begin of starttime.
            include structure tbtcstrt.
    data: end of starttime.
    data: starttimeimmediate like btch0000-char1.
    Job open
      call function 'JOB_OPEN'
           exporting
                delanfrep        = ' '
                jobgroup         = ' '
                jobname          = jobname
                sdlstrtdt        = sy-datum
                sdlstrttm        = sy-uzeit
           importing
                jobcount         = jobcount
           exceptions
                cant_create_job  = 01
                invalid_job_data = 02
                jobname_missing  = 03.
      if sy-subrc ne 0.
                                           "error processing
      endif.
    Insert process into job
    SUBMIT zreport and return
                    with p_param1 = 'value'
                    with p_param2 = 'value'
                    user sy-uname
                    via job jobname
                    number jobcount.
      if sy-subrc > 0.
                                           "error processing
      endif.
    Close job
      starttime-sdlstrtdt = sy-datum + 1.
      starttime-sdlstrttm = '220000'.
      call function 'JOB_CLOSE'
           exporting
                event_id             = starttime-eventid
                event_param          = starttime-eventparm
                event_periodic       = starttime-periodic
                jobcount             = jobcount
                jobname              = jobname
                laststrtdt           = starttime-laststrtdt
                laststrttm           = starttime-laststrttm
                prddays              = 1
                prdhours             = 0
                prdmins              = 0
                prdmonths            = 0
                prdweeks             = 0
                sdlstrtdt            = starttime-sdlstrtdt
                sdlstrttm            = starttime-sdlstrttm
                strtimmed            = starttimeimmediate
                targetsystem         = host
           exceptions
                cant_start_immediate = 01
                invalid_startdate    = 02
                jobname_missing      = 03
                job_close_failed     = 04
                job_nosteps          = 05
                job_notex            = 06
                lock_failed          = 07
                others               = 99.
      if sy-subrc eq 0.
                                           "error processing
      endif.
    Thanks
    Sudheer

Maybe you are looking for