Java Detection Process

I work on an application that uses applet that would run on a specific version of JRE. Also the application should support multiple browsers(IE, FireFox & Safari). When an user accesses the application with no JRE they get an option to install JRE. But the problem is that the user has to restart the browser after JRE installation. User has set of activities to do before getting to this applet. Java detection happens only when they access applet portion. We have a situation that we cannot push the Java detection ahead in time. Is there a way to have Java installation done from within an instance of browser, say FireFox, and use it right away in an applet without restarting? This seems to work with Internet Explorer through Active X plug-in but we want to stay away from Active X plugin. Also this doesn't work on all browsers. Any help in this regard will be highly appreciated.
Thanks!
Jay

There are no easy answers. You can either:
1) Close the browser. Then open the browser again
2) Use navigator.plugins.refresh(false) to refresh the navigator array. Then reload that page or open a new window (using window.open)
or
3) Use navigator.plugins.refresh(true), which refreshes the navigator array and then reloads the page.
The key here seems to be to refresh the navigator array, and then reloading the page or opening a new window. I don't think there is any other option.
Eric

Similar Messages

  • Java.lang.process.execute()

    Java.lang.process.execute() is throwing an exception with string �Cannot allocate memory� ...
    what is the cause of this exception and give me the solution
    plz help
    Nilesh

    882590 wrote:
    Is it possible to use the java.lang.ProcessBuilder to execute a Java process pointing it to jvm.dll instead of java.exe? I'm using the JavaFX self contained application packaging and it creates a runtime/jre/bin directory that contains jvm.dll, but not java.exe.I don't get the line of questioning of this thread. If you're using the JavaFX stuff the answer must lie in the JavaFX documentation. It seems to indicate that it generates an executable of its own which will likely wrap the jvm DLL, so you should be invoking the generated executable in ProcessBuilder.
    http://docs.oracle.com/javafx/2/deployment/self-contained-packaging.htm

  • Java Business Process Monitoring

    Hello Experts,
    I want to setup Business Process Monitoring between Solman and ECC system.
    Is it possible to setup the JAVA Based  Business process monitoring ?.
    If its possile how to setup for JAVA Busness process monitoring.
    Thanks
    Nikkil

    Hello Nikkil,
    there is no content currently shipped in order to perform Business Process Monitoring for Java components. Can you specify what kind of application you are looking at and what it would be that you owuld like to monitor as part of a business process?
    We could then evaluate in what way a corresponding enhancement for Business Process Monitoring could be also useful for other customers.
    Best Regards
    Volker

  • Java.lang.Process.exec()

    I have read a article about the "java.lang.Process.exec()" (url:http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html)
    Having some questions with the example in it.
    The example code:
    import java.util.*;
    import java.io.*;
    public class BadExecJavac
        public static void main(String args[])
            try
                Runtime rt = Runtime.getRuntime();
                Process proc = rt.exec("javac");
                //int exitVal = proc.exitValue();
                int exitVal = proc.waitFor();
                System.out.println("Process exitValue: " + exitVal);
            } catch (Throwable t)
                t.printStackTrace();
    }The process can run but never complete.
    Why? Just because when invoke the javac.exe without any argument,it will product a set of usage statements that describe how to run the program and the meaning of all the available program options.So the process is in deadlock.
    The question is, when i change the exec("javac") to exec("javac a.java"), in which the "a.java" is not exist, so the jvm should product error:
    error: cannot read: a.java
    1 error
    But after i changed the code and run the class, at this time the process can run and complete.
    The two codes both product some statements,but why the first one never complete,but the second did. Why?

    import java.util.*;
    import java.io.*;
    public class A
        public static void main(String args[])
            try
                Runtime rt = Runtime.getRuntime();
                Process proc = rt.exec("javac");
                InputStream is = proc.getErrorStream();
                int i=0;
                while ((i = is.read()) != -1)
                    System.out.print((char)i);
                // int exitVal = proc.exitValue();
                // int exitVal = proc.waitFor();
                // System.out.println("Process exitValue: " + exitVal);
            } catch (Throwable t)
                t.printStackTrace();
    }usng this modification, i could see some error messages.
    because exec(cmd) executes the command in a separate process, it will not display the results on the current console. If you want see the results, you should use getInputStream() and getErrorStream().
    good luch ^^

  • Java.lang.Process input stream waiting until process is complete to print

    I have tried to simplify this problem as much as possible. Basically, I have a java.lang.Process which executes a simple C program.
    test.c
    #include <stdio.h>
    #include <unistd.h>
    int main()
      printf("foo\n");
      sleep(2);
      printf("bar\n");
    ...The process has an input stream and error stream handler each on a separate thread. I have tried both buffered and unbuffered (BufferedReader, BufferedInputStream, InputStreamReader...) stream handlers. Both produce the same problem of waiting until the process has exited to receive anything from the process's streams.
    The only time this does not happen is when I call fflush(stdout); after each printf(). This can't be a solution because the real application calls a massive C application which would require thousands of fflush()'s to be added. What is causing this to happen? This doesn't happen when the C program is executed from the shell. Is there a way the InputStream can be forced to extract from the stream?

    hi.....
    I have closed the output stream of the process as you told me to do...
    The hitch is that, if my program contains only printf() statements,it works fine
    as soon as scanf() statement is encountered within the C code,it is totally neglected,and the output comes as if no scanf() statement existed in the C code.
    Consequently the thread doesnt wait for input which was bound for scanf() from the thread
    the code...
        public void run()
         try
             PrintWriter out = new PrintWriter(socket.getOutputStream(),true);
             BufferedReader in = new BufferedReader(
                            new InputStreamReader(
                            socket.getInputStream()));
             try
                     Process p;
              p=new ProcessBuilder("./a.out").start();
                     PrintWriter exOut=null;
                     BufferedReader exIn=null;
              exOut = new PrintWriter(p.getOutputStream(),true);
              exIn = new BufferedReader(
                           new InputStreamReader(
                           p.getInputStream()));
                  //String inputLine="", outputLine="";        
                  String str="";
                     int c;          
                  while(true)                   
                        //System.out.println("In While");
                  str="";exOut.close();                  
                        while((c=exIn.read())!=-1)
                                 str=str+(char)(c);
                                    System.out.print(str);
                        str=str+(char)(0);
                        System.out.print(str+"outside");
                        out.print(str);
                        sleep(100);
                        try
                            int x=p.exitValue();
                              out.print(str);
                   System.out.print("Bye 1");
                            String str1="Bye"+(char)(0);
                   out.println(str1);              
                   break;
                        catch(IllegalThreadStateException e)
                            //System.out.println("The Process has not ended yet");
                        //str=str+((char)-1);
                        //System.out.print(str+"Control reaches here too");
                        str="";
                        exOut = new PrintWriter(p.getOutputStream(),true);//I have tried to run the program without this also but the effect is the same
                        while((c=in.read())!=-1)
                            str=str+(char)(c);                                    
                        if(str.contentEquals(""))
                                System.out.print("Bye 2");
                                String str1="Bye"+(char)(0);
                                out.println(str1); 
                                p.destroy();
                                exOut.close();
                                exIn.close();
                                out.close();
                                in.close();        
                                socket.close();
                                break;
                        //str=str+(char)(0);
                  exOut.print(str);
                        try
                            int x=p.exitValue();
                            System.out.print("Bye 3");
                            String str1="Bye"+(char)(0);
                   out.println(str1);
                            break;
                        catch(IllegalThreadStateException e)
                            //System.out.println("The Process has not ended yet");
                  /*while ((inputLine = in.readLine()) != null)
                        exOut.println(inputLine);
                        outputLine=exIn.readLine();
                        //outputLine=inputLine;
                        //out.println(outputLine);}*/                   
             exOut.close();
             exIn.close();
             catch(IOException e)
                  System.err.println("Accept failed."+e);
             out.close();
             in.close();        
             socket.close();
         catch (Exception e)
             e.printStackTrace();
    }

  • Java Compilation Process and how it relates to portability

    I need to know more about the java compilation process, how it achieves porability and its drawback and benifits. Can anyone help me with a link or an answer?
    Help would be much appriciated!

    javac, the Java compiler, is written in Java itself. It generates .class
    files from your .java source files. Those .class files are loaded by the
    JVM (the Java Virtual Machine) and executed. The javac compiler
    itself consists of just a bunch of those .class files and the compiler
    doesn't even know on what platform it is running while compiling
    your .java files.
    If you simply carry over the tools.jar file (and some other .jars) in which
    the package com.sun.tools.javac resides to another platform where a
    JVM is installed you can compile your .java files on that other platform
    too. And those compiled classes will run on that platform too ;-)
    kind regards,
    Jos

  • Problem with starting a sqlplus-process via java.lang.Process

    Hi,
    I want to start a sqlplus-Process from a java-application via java.lang.Process. Works great with XP. On a W2K-Machine, the process is started (I can see it in the Taskmanager), but it doesn't connect to the db - the OS-process hangs, also the java-application which invoked the process.
    If I start a sqlplusw.exe-Process instead of sqlplus.exe, it works as well.
    Does anybody know what's going wrong ?
    I'm using java 1.5.0_11 and Oracle Database 10g Enterprise Edition Release 10.2.0.3.0
    Thanks in advance
    Jens

    java.lang.Process can be used to perform an OS Shell to launch specific tasks. But why are you interested in specifically launching sqlplus from here?
    ~ Madrid
    http://hrivera99.blogspot.com/

  • PROBLEM:IOException starting Java runtime process

    Hi all,
    I am new to java and I have the following problem: I have created an applictaion using jbuilder (windows xp) that consists of various frames.
    The application was compling and running at the PC I used to create it . Now, I am using a new PC with 2 processors (intel Pentium (D) 3.6) and I get the following error when trying to run the already developed application. Also, I tried to build a new application and I still get the same error.
    I would be very greatful for your comments/suggestions..
    Thanks in advance
    artakianos
    -- IOException starting Java runtime process --
    java.io.IOException: CreateProcess: "C:\Program Files\Borland\Jbuilder\jdk1.4\bin\javaw" -classpath "C:\Documents and Settings\sstathak\jbproject\MCTOOLS\classes\mctools;C:\Borland\JBuilder2005\lib\jbcl.jar;C:\Borland\JBuilder2005\lib\dx.jar;C:\Borland\JBuilder2005\lib\beandt.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\javaws\javaws.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\lib\charsets.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\lib\ext\dnsns.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\lib\ext\ldapsec.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\lib\ext\localedata.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\lib\im\indicim.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\lib\im\thaiim.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\lib\jce.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\lib\jsse.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\lib\plugin.jar;C:\Program Files\Borland\Jbuilder\jdk1.4\jre\lib\rt.jar;C:\Program F&#148;

    Maybe your classpath is wrong. You can go to the path where is the instalation and into the directory bin you must `type javac or javaws if you obtain a list of options every is ok and you must set the enviroment variable to this path.
    Send me your comments
    Miguel Manzano

  • Java.exe process

    I've been searching high and low to figure out how to set a java.exe process to high all the time. Its for a server that i run and im learing java in school just havent gotten to that class yet. Its a batch file but when i set it to start/high it doest alow the server to restart, just shuts it down. with out the comand its fine, but id have to go to task manager to set the priority to high. Is there a way to make it High all the time??? thanks.

    Grimm0ne wrote:
    I've been searching high and low to figure out how to set a java.exe process to high all the time. You mean thread priority?
    Its for a server that i run and im learing java in school just havent gotten to that class yet. Its a batch file but when i set it to start/high it doest alow the server to restart, just shuts it down. with out the comand its fine, but id have to go to task manager to set the priority to high. Is there a way to make it High all the time??? thanks.I don't know of any such thing.
    %

  • Two java.exe processes running in the Task Manager in Windows XP

    I tried to find the best possible place to post this and after spending about 20 minutes searching for an appropriate forum starting from java.com I ended up here. So forgive me if the is a wrong place and if there?s a more appropriate place for my question, please provide a pointer to it.
    I don't know much about java and what it does but as the title says when I open the Task manager there are two java.exe processes running at the same time with about 20 000 k each.
    One of the processes is coming from:
    C:\Program Files\Alias\Maya6.5\docs\jre\bin\java.exe
    and the other from:
    C:\Program Files\Alias\Maya7.0\docs\jre\bin\java.exe
    in addition to that a jusched.exe process is also running coming from
    C:\Program Files\Java\jre1.5.0_10\bin\jusched.exe
    I rarely open the Maya 6.5 and 7 documentations but the two java.exe process are running all the time and I would like to stop them running when I don?t need them but I don?t know how.
    I can't end these processes from the Task Manager; they reappear immediately after I end them.
    Any help with this is greatly appreciated.
    Thank you

    Try to see:
    http://forums.cgsociety.org/showthread.php?t=294973
    Bye,
    leo

  • IOException starting Java runtime process

    Whenever i run a program, i get this error
    -- IOException starting Java runtime process --
    java.io.IOException: CreateProcess: D:\Borland\JBuilder2005\jdk1.4\bin\javaw -classpath "E:\Documents and Settings\Administrator\jbproject\SwingApplication\classes;D:\Borland\JBuilder2005\jdk1.4\jre\lib\im\indicim.jar;D:\Borland\JBuilder2005\jdk1.4\jre\lib\im\thaiim.jar;D:\Borland\JBuilder2005\jdk1.4\jre\lib\ext\dnsns.jar;D:\Borland\JBuilder2005\jdk1.4\jre\lib\ext\sunjce_provider.jar;D:\Borland\JBuilder2005\jdk1.4\jre\lib\ext\ldapsec.jar;D:\Borland\JBuilder2005\jdk1.4\jre\lib\ext\localedata.jar;D:\Borland\JBuilder2005\jdk1.4\jre\lib\jsse.jar;D:\Borland\JBuilder2005\jdk1.4\jre\lib\plugin.jar;D:\Borland\JBuilder2005\jdk1.4\jre\lib\sunrsasign.jar;D:\Borland\JBuilder2005\jdk1.4\jre\lib\charsets.jar;D:\Borland\JBuilder2005\jdk1.4\jre\lib\rt.jar;D:\Borland\JBuilder2005\jdk1.4\jre\lib\jce.jar;D:\Borland\JBuilder2005\jdk1.4\jre\javaws\javaws.jar;D:\Borland\JBuilder2005\jdk1.4\lib\tools.jar;D:\Borland\JBuilder2005\jdk1.4\lib\dt.jar;D:\Borland\JBuilder2005\jdk1.4\lib\htmlconverter.jar" swingapplication.SwingApplication error=3
    I use JBuilder , if this error is related to classpath, how do i set path? please help me

    Can javaw.exe be found at that location?
    - Saish

  • Execution of Java Native Process slow in Mac OS X

    Hi,
    I'm having some performance issues when executing an java native process on Mac OS X. I am developping an application in AIR that searches for people in the ldap of our organisation. It has to be usable both on Mac as on Windows. When I execute my app on windows, the search process takes about 2-3 seconds. However, when I try to execute it on mac, the search process takes about 6-8 seconds. This is a bit to long to make it usable.
    Has anybody encountered this problem as well and does anyone know what the problem can be?
    Thanks in advance
    Ronald Kamp
    Junior Flex/Java/LiveCycle Consultant at iDA MediaFoundry

    Hi Ronald,
    Have you tried benchmarking your java process without the inclusion of AIR?  If so, did you find a difference which points to AIR being a culprit for the performance hit?
    I'd be very interested in trying this out.  If you could provide me with a sample project that illustrates the slow down on Mac, I'll take a look right away.  Please feel free to contact me via private message on the forum or at [email protected] if you'd like to take this offline.
    Thanks,
    Chris

  • Problwm with java.lang.Process

    I am using java.lang.Process to read the output of a command, it works fine with one word commands such as "ls", but a command with a pipe and and arguments returns no output, for example "who | grep root".
    Any ideas!

    for example "who | grep root".
    Any ideas! Probably because you really should have nothing returned. Try to give the output of the first command as an input to the second one but not through a pipe; use java.lang.Process twice.

  • Get complete output from java.lang.Process

    How do I get the complete output from java.lang.Process?
    By the time I've started reading from Process.getInputStream() the process has already terminated...

    I solved the problem:
    private int exec(String pArguments[], OutputStream pOut, OutputStream pErr) throws IOException {
         class ProcessOutputPrinter implements Runnable {
              private InputStream ivIn;
              private OutputStream ivOut;
              public ProcessOutputPrinter(InputStream pIn, OutputStream pOut) {
                   ivIn = pIn;
                   ivOut = pOut;
              public void run() {
                   try {
                        for(int tByte; (tByte = ivIn.read()) != -1; ) {
                             ivOut.write(tByte);
                        ivOut.flush();
                   catch(IOException e) {
                        e.printStackTrace();
         // Start process
         Process tProcess = Runtime.getRuntime().exec(pArguments);
         // Create out printer
         Thread tOutPrinter = new Thread(new ProcessOutputPrinter(tProcess.getInputStream(), pOut), "NamingAdmin out-printer");
         tOutPrinter.start();
         // Create err printer
         Thread tErrPrinter = new Thread(new ProcessOutputPrinter(tProcess.getErrorStream(), pErr), "NamingAdmin err-printer");
         tErrPrinter.start();
         // Wait for process and printers to finish
         try {
              tProcess.waitFor();
              tOutPrinter.join();
              tErrPrinter.join();
         catch(InterruptedException e) {
         // return process exit value
         return tProcess.exitValue();

  • Java.lang.Process output stream problem

    Hi, I have a program that starts a process (java.lang.Process) using the java.lang.Runtime.exec() and it attemtps to interface with it using the provieded io streams. I have both the output and error streams being handled on their own threads and I have a hashmap of output lines/command pairs that are checked so that when the process outputs certain lines to the console it feed the proper input into the process. My problem is that when I feed the input into the process it dosen't respond to it almost like the user hasn't pressed enter, The process hangs. I have tried using /n /r and permutations thereof but nothing works. The thread does read the lines from the process and does output to the process from what i can gather. Can you help me!
    here is some of the code..
    public void run() {
    try {
         //the process's output
         InputStreamReader isrOutput = new InputStreamReader(inOutput);
         //the process's input(our output)
         PrintWriter pw = new PrintWriter(outInput);
         String line = null;
         while(true){
              if(brOutput.ready()){
                   line = "";
                   while(brOutput.ready())
         line+=(char)brOutput.read();
                   System.out.print(line);
                   if(commands.containsKey(line)){
         pw.println((String)commands.get(line));
         System.out.println((String)commands.get(line));;
    } catch (IOException ioe) {
              ioe.printStackTrace();
    }Thanks

    Oops.. i forgot to flush my PrintWriter /blushing......... Thanks

Maybe you are looking for