Launch a java program in a specific tty

Hello,
I'm writing a popup program (with Swing) which has to launch popup in every tty where a user is logged in.
I succeeded to get the list of tty where my user is logged in but i don't know how to show my popup (JOptionPane.showMessageDialog(...)) in these.
Thanks for all.
Mik

a virtual terminal in Unix OS

Similar Messages

  • Execute Java Program in a specific time everyday

    Hi All,
    I need help for Execute Java Program in a specific time everyday.
    I want to do insert data into database every 3:00 AM everyday.
    I thought there is a one thread program will do. It is correct my understanding? Please let me know and guide me How can I do?
    Thanks
    Amit

    If you are using Window$ then you can create a bat file to execute the program and place the bat file in Scheduled Tasks.

  • Launch many java programs at runtime

    Hi i got one question.
    i have a list of java program ina file.
    i read this file and get each program names.
    i would like to launch all java programs at Runtime from my main Java application.
    here is my code so far:
    String fileName = expansion + ".txt";
              try
                   File file = new File(fileName);
                   FileReader     fileReader= new FileReader(file);
                   BufferedReader bufferReader = new BufferedReader(fileReader);
                   while((program=bufferReader.readLine())!= null)
                        Runtime launch=Runtime.getRuntime();
                        System.out.println("I launch "+ program);
                        launch.exec("cmd.exe /c start /c cd /bin");
                        launch.exec("java "+program);
    this does not work. How can i handle this?
    thank you
    seb

    while((program==bufferReader.readLine())
    != null) {Sorry, I meant
    while((program==bufferReader.readLine())!= null) {{=^)                                                                                                                                                                                                                                                                                                                                                                   

  • Launching a Java Program from UNIX ( C/C++ )

    How do I launch my Java program from c/c++? Do I need to wrap my java command line ( ie. java -classpath .... ) in a C shell ? Is there another way?

    How do I launch my Java program from c/c++? Do I need
    to wrap my java command line ( ie. java -classpath
    .... ) in a C shell ? Is there another way?You can do it directly using Java Native Interface (JNI). Using this approach the Java program runs in the current process.
    Sylvia.

  • How to launch a java program in a new process

    Hello !
    II have a Java program, in which I want to carry out another Java program but in a new process, this new program requiring the definition of constants to the launching of the JVM.
    How can I do it ?
    Tank you for your help.

    Use
    Runtime.getRuntime().exec( cmd ); //where cmd is command for run java program.
    cmd may be "java test".
    You may also try using jnlp to run you java program in a new process.
    cmd will be "cmd /c \"javaws " + jnlpFile + "\"";

  • Running a java program at "Start Up"

    Besides running an html file with an applet in it. Are there any simple ways to launch a java program every time the computer is turned on.
    I am not asking for specific directions, but rather just an idea, and i will go find my own guide.

    Well two ideas (if ur on windows) u could try are -
    one, if you had a class file you could simply create a
    batch file on windows that says java <class> and then
    put that batch file in your startup so that the class
    is run at startup or else you could think of modifying
    the registry keys on windows to run this class at
    startup - whichever works for you.Or you could just jar the program up, adding a Main-Class indicator in the manifest, and then add a shortcut to the jar to the startup folder, as someone else stated. Theres little need to go messing around with DOS batch in modern windows.

  • Start a java program from an FMB then read and write some variables

    Hello,
    I am trying to see whether the following setup works:
    item A, B, D and Button Z are on a Forms Canvas.
    User clicks on Button Z. This will launch a java program (Myprog class).
    Myprog main will read values in item A and B, run some calculation and then will return it back to our forms module and then will be displayed in item D.
    I have read about PL/SQL wrapper but the way I am looking at my setup is that my Forms module will be just the GUI interface.
    Any ideas ?

    main thing: a JAVA class that will take some inputs and will output some results and messages.
    Prob: I do not want to use swing or any other GUI builder to make a nice GUI for my JAVA class.
    What I want: I know how to use Forms. As such, I just want to put together a quick interface (mymodule.fmb) that when executed will allow the user to click on a button to start the java process and then see the results and error messages.
    Why I don't want to go through SWING: my main prob is to get the java class executed ( which is fine right now thru command line) by other users thru a GUI interface. I do not have time to go thru SWING.
    From the paper I mentioned, I think the PJC is the way to go. Can you please confirm ?
    Thanks.

  • Calling a Java Program from another

    Hi,
    I am putting together a Java program which will launch other Java programs.
    I was thinking of doing this by calling unix scripts from my java program by getting an instance of the Runtime object and then calling the exec method with the script name.
    I am just wondering what is the best practice when doing this? i.e., dealing with timeout issues, and errors in the scripts etc.
    I have read this article, which is quite good: http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html?page=1
    Is there any code available on the web that deals with all of the basic error scenarios?
    Is it good practice to use a java program to call another java program? Or is there a better way of doing this?
    The main reason I am using java is because I am most familiar with it and I need to connect to a database as well and do some manipulation of results returned.
    Any thoughts or suggestions would be much appreciated.
    Message was edited by:
    LondonJavaDev

    Thanks Prometheuzz
    Is the main difference between your suggestion and
    using the Runtime.getRuntime().exec(cmd) way of doing
    things is that in the former both eill run as the
    same process (Thread) but in the second scenario the
    .getRuntime().exec(cmd) will start a separate new
    thread?
    Many ThanksCorrect. But you can create a sort of wrapper class for A which implements Runnable and stuff it in it's own thread. If you're dealing with Java code only, I advise you to create threads yourself instead of letting your OS handle them.
    Here's a demo:
    class Foo {
        public static void main(String[] args) {
            (new Thread(new ARunner())).start();
            B.main(null);
    class ARunner implements Runnable {
        public void run() {
            A.main(null);
    class A {
        public static void main(String[] args) {
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) { /* ... */ }
            System.out.println("A");
    class B {
        public static void main(String[] args) {
            System.out.println("B");
    }Of course, you can create a wrapper for B as well.

  • How to launch a java application from Microsoft SQL Server

    Hi everyone
    I noticed the following line in a trigger will launch an executable.
    EXEC master..xp_cmdshell '"C:\Program Files\SkillSets.exe"', NO_OUTPUT
    Does anyone know if this same statement will launch a java program? Or does anyone have any positive experience with that ?

    yes...
    check this basic example:
    public class GoodWindowsExec{
    public static void main(String args[]){
    if (args.length < 1){
    System.out.println("USAGE: java GoodWindowsExec <cmd>");
    System.exit(1);
    try{           
    String osName = System.getProperty("os.name" );
    String[] cmd = new String[3];
    if( osName.equals( "Windows NT" ) ){
    cmd[0] = "cmd.exe" ;
    cmd[1] = "/C" ;
    cmd[2] = args[0];
    }else if( osName.equals( "Windows 95" ) ){
    cmd[0] = "command.com" ;
    cmd[1] = "/C" ;
    cmd[2] = args[0];
    Runtime rt = Runtime.getRuntime();
    System.out.println("Execing " + cmd[0] + " " + cmd[1]
    + " " + cmd[2]);
    Process proc = rt.exec(cmd);
    // any error message?
    StreamGobbler errorGobbler = new
    StreamGobbler(proc.getErrorStream(), "ERROR");
    // any output?
    StreamGobbler outputGobbler = new
    StreamGobbler(proc.getInputStream(), "OUTPUT");
    // kick them off
    errorGobbler.start();
    outputGobbler.start();
    // any error???
    int exitVal = proc.waitFor();
    System.out.println("ExitValue: " + exitVal);
    } catch (Throwable t)
    t.printStackTrace();

  • Running another java prog from a java program

    hi,
    I would like to add a button to my program in which when pressed, it will launch another java program.
    so far i googled and found out how to run from this site:
    http://www.devx.com/tips/Tip/13867
    but when the 2nd program is launched, the first program become inaccessible until the 2nd program is terminated.
    is there any way to run the program without causing the first program inaccesible? thank you

    run the commands in seperate threads.
    http://java.sun.com/docs/books/tutorial/essential/threads/

  • Java programs which require a specific version of java won't work

    So I'm running 10.4 on my macbook pro, and when I try to run a java program that requires any version of java, I get an error saying I don't have that version. Java works fine from the command line when I run programs I wrote, and java -version outputs:
    java version "1.5.0_16"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-275)
    Java HotSpot(TM) Client VM (build 1.5.0_16-132, mixed mode, sharing)
    When I try to run something (say, some java applet), I get the message:
    Could not launch the application because it requires a version of Java that is not installed.
    (in smaller print):
    This application requires Java 1.4 or later, but only the following Java versions are installed: . Updating to a newer version of Mac OS X may resolve this.
    The message makes me think that in some text file or some preference somewhere, the thing that tells the system what version of Java I have got deleted. Anyone have any ideas of something I can do to fix it?

    I usually use Win 7 and lately have been playing with the Win 10 preview. I like Win 7.

  • How can my java program launch other applications?

    can anyone link me, provide some keywords, or information on how a java program can execute another program... for example, a button click would launch acrobat, firefox, or (in particular) another java application.

    don't read all that much fantasy.
    I've read Eddings' Belgariad and Malloreon, which I really liked at the time but which are not even in the same league as GRRM. The characters are much more one-dimensional, and the plot gets cornier as you go along.
    IVE READ BELGARIOD... AGREE THAT IT WAS PRETTY SHALLOW AND I READ IT AFTER LOTR SO IT WAS SUCH A PALE RIPOFF IN COMPARISON
    His Elenium and Tamuli series were a little better, but still far from Ice and Fire.
    Tolkein, of course, but you've probably heard of him. :-)
    Donaldson's Mirror of Her Dreams and A Man Rides through were good.
    HAVENT READ THESE, WILL ADD TO MY LIST, THANKS!
    Terry Brooks' Shanara series is supposed to be pretty good, and I think Anne McCaffery's Dragonriders of Pern series is considered to be among the classics, but I've never read either one.
    READ SOME BROOKS AND FOUND IT SHALLOW LIKE EDDINGS. HAVE READ MCCAFFERY BUT NOT DRAGONRIDERS, AND THE TRILOGY I READ WAS OK BUT THE TONE WAS REALLY GOOFY. A GROUP OF REFUGES ON A NEW PLANET AT A TIME WHEN THE HUMAN RACE IS ENSLAVED BY ALIENS, AND THE BOOK SEEMED TO FOCUS ON HOW FUN BUILDING A CAMP WAS ON THE NEW PLANET AND EVERYONE WAS REALLY PEPPY WHICH FELT ODD GIVEN THE CIRCUMSTANCES OF THE SETTING.
    Michael Moorcock's Elric series was very good, also very dark. It was kind of... I don't know... odd. Like you'd want to light up a bong and put on some Floyd while reading it.
    HAVENT READ EITHER, ANOTHER FOR THE LIST, THANKS AGAIN!
    There's another series of 2 or 3 books that I read a few years ago and really liked, but I can't for the life of me remember the author, the books, any characters names...
    P.S. If you want to talk about a nag of a female character, you gotta love (as in hate) Cersei. She gets her on POV in Feast. Good stuff.
    YEAH I LIKE CERSEI ACTUALLY. GRRM IS GOOD IN HOW THERE REALLY IS NO MAIN CHARACTER AND EVERYONE IS VERY EXCITING TO READ. RJ ON THE OTHERHAND HAS A DEFINATE CENTRAL CHARACTER TO THE PLOT, AND CHAPTER AFTER CHAPTER OF SOME OF THE FEMALE POV'S GOT AGGRAVATING ESPECIALLY WHEN THEY NAG SO MUCH THE TRUER HEROS OF THE STORY (MY OPINION)... ITS LIKE, SHUT YOUR MOUTH AND LET THEM SAVE THE DAY ALREADY... HEHE... BUT YOU'LL SEE OR HAVE A DIFFERENT OPINION ENTIRELY.
    to you i recommend orson scott card... you've probably read ender's game but he has some really good fantasy too... the homecoming series (first book call of earth or memory of earth) was really good, and the alvin maker series is ok plotwise but the characters are incredible... i found a lot of humor and witty dialog in that series and enjoyed it immensely. anyways, thanks again for the list additions, will read feast of crows first, hopefully soon. glad to hear you're liking it... some reviews on amazon weren't stellar.

  • [Solved] systemd - Auto starting programs under specific tty

    Is there any way to start a program on an empty tty?
    Currently i run htop on tty11 and a log on tty12 using the default startup scripts with something like this,
    htop:2345:respawn:/usr/bin/htop -d=10 > /dev/tty11
    I've tried played around with systemd for a while but can't get it working. There doesn't seem to any documentation for launching anything except additional gettys, so i tried to modify one of the .service file for htop but didn't make any progress.
    Does anyone else know how to get this working?
    Thanks
    Last edited by CaseMonster (2011-11-02 23:34:20)

    Okay I figured out how to properly run services on systemd, here's the newest .service file
    [Unit]
    Description=htop on tty11
    After=dev-tty11.device systemd-user-sessions.service
    [Service]
    ExecStart=/usr/bin/htop -d=100 > /dev/tty11 < /dev/tty11
    Type=oneshot
    [Install]
    WantedBy=multi-user.target
    And when running i get this
    systemctl status htop.service
    htop.service - htop on tty11
          Loaded: loaded (/lib/systemd/system/htop.service; enabled)
          Active: failed since Wed, 02 Nov 2011 02:57:08 -0500; 1s ago
         Process: 1452 ExecStart=/usr/bin/htop -d=100 > /dev/tty11 < /dev/tty11 (code=exited, status=1/FAILURE)
          CGroup: name=systemd:/system/htop.service

  • Launching applications from within a Java program,

    Hi all,
    I wish to launch an application from a menubutton. I exactly wish to launch adobe acrobat reader and a specific file. Do I need to run a system command to do this, or more specifically, how is this done in Java?
    Thanks,
    JavaRob

    what if you have the entire exe as a byte array in
    memory, write that to a file on the system, and then
    run that file.
    would that work?Yes but you would still have to use the Runtime class to excecute the file after you write it out, so it would just be easier to use the already made exe file.

  • Launching JNLP from a Java Program

    Hi All,
    Can anyone please let me know if I can launch a JNLP from a java program. The requirement is that there are two applications and I need to integrate both of them. So I need to call the other program from this. Can this be accomplished.
    Thank you,
    Thanks and Regards
    Mouli

    [Desktop.browse(jnlpUri)|http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html#browse(java.net.URI)]

Maybe you are looking for

  • How do I get rid of expired rental movies that won't go away

    I have three rental movies, one from September, that have viewed and/or the rental period expired. The movies say expired on the iTouch and won't play. They won't go away and their are consuming disk space. The don't show up in iTunes. How can I get

  • Oracle 8i type4 jdbc driver (classes1.2.zip) refreshRow() error...

    Hi there, I am implementing a distributed app using Oracle8 Server and the Oracle 8i 8.1.6 driver for JDK 1.2.x . I have created a prepared statment which uses the scrollable result set as follows: do connection stuff... PreparedStatement pstmt2 = nu

  • Output  Proposal  not automatically proposed

    Hi Experts, I have created a condition record for output type Zquo . When I do the output determination analysis and click on condition access i see a message < b condition found /b> and System Response says "An output proposal is created". Even afte

  • Future of Business Packages

    Hi, I was wondering if somebody knows or can give an opinion about how the future of the business packages (such as ESS) looks like? I see that there are still some updates of it with support packages. If there is a future for it then I like to know

  • Can I share calendars on a mac running 10.6 with a mac running 10.4?

    I'm using DropBox. I'm guessing the files for iCal on 10.6 are not the same (ant not compatible) as/with the files used on iCal in 10.4 correct?