Hi i wrote a java program for scanning a system for java.exe 's

hi ,
i wrote a program which scans the system for java.exe 's and then it captures them in a linked list and then i
iterate through it for "\\Java\\jdk1.5.0_08\\bin\\java.exe and my aim is to return true in case the linked list contains the string "\\Java\\jdk1.5.0_08\\bin\\java.exe" and stop scanning the system.
If the linked list does not contain "Java\\jdk1.5.0_08\\bin\\java.exe" it should return false.
But my problem is the program is continuing to scan the system even if the linked list has "\\Java\\jdk1.5.0_08\\bin\\java.exe"
Any sort of help is appreciated.
The code is as follows:
package com.installanywhere.exper;
import com.zerog.ia.api.pub.CustomCodeRule;
import com.installanywhere.exper.SearchTool;
* @author
public class eFileTool extends CustomCodeRule {
     /* (non-Javadoc)
     * @see com.zerog.ia.api.pub.CustomCodeRule#evaluateRule()
     @Override
     public boolean evaluateRule() {
          // TODO Auto-generated method stub
          SearchTool searchtool=new SearchTool();
          boolean valueTocheckfor=false;
          valueTocheckfor=searchtool.find();
          String someothervalue=Boolean.toString(valueTocheckfor);
          if(someothervalue.equalsIgnoreCase("true")){
               return true;
               //System.exit()
          else if(someothervalue.equalsIgnoreCase("false")){
               try {
                    Thread.sleep(5000);
               } catch (InterruptedException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
          System.out.println(valueTocheckfor+"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
          return valueTocheckfor;
The code of search tool is
package com.installanywhere.exper;
import java.io.*;
import java.util.*;
public class SearchTool
     * @param args
static     boolean valuesToReturn=false;
static     boolean anothervalueToRefer=false;
     public static void main(String[] args) {
          // TODO Auto-generated method stub
          SearchTool           t = new SearchTool();
          System.out.println("xxxxxxxxxxxxxxxxxxxx");
          boolean someArgument=t.find();
          System.out.println(someArgument+"iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii"+"");
               public boolean find()
                    System.out.println("2222222222222222222");
               boolean someThing=searchcomp("java.exe");
               System.out.println(someThing+"inside the othere one");
               return someThing;
          public boolean searchcomp(String file)
               System.out.println("3333333333333333333333");
               File[] drives=File.listRoots();
               boolean valueIdentified=false;
               for (int ctr=0;ctr<(drives.length-1);ctr++)
                    valueIdentified=search(drives[ctr],file);
                    System.out.println("4444444444444444444");
               System.out.println(valueIdentified+"something i need to accomplish");
               return valueIdentified;
               public boolean search(File dir,String file)
               File[] directories=dir.listFiles();
          System.out.println("55555555555555555555555");
               if (directories == null)
                    System.out.println("666666666666666666666666");
               return false;
               for(int ctr=0;ctr<directories.length;ctr++)
                    if(directories[ctr].isDirectory())
                         System.out.println("77777777777777777777777777");
                         valuesToReturn=search(directories[ctr],file);
                         System.out.println(valuesToReturn+"india is great");
                    else
                         if(directories[ctr].getName().equals(file))
                              String path = directories[ctr].getAbsolutePath().toString();
                              System.out.println(path);
                              List someList=new LinkedList();
                              anothervalueToRefer=allPaths(path);     
                              System.out.println(anothervalueToRefer+"god damn it");
                                   //System.out.println(anothervalueToRefer+"let me seeeeeeeeeeeeeeeeeee");                                        
                              return anothervalueToRefer;
               return valuesToReturn;
               public boolean allPaths(String allPath)
                    List l=new LinkedList();
                    String somepath=allPath;
                    l.add(somepath);
                    //return l;
/*if(l.contains("C:\\Program Files\\Java\\jdk1.5.0_08\\bin\\java.exe")){
                         System.out.println("yepeeeeeeeeeeeeee");
                         //System.exit(0);
else{
     System.out.println(" the face");
                    ListIterator li = l.listIterator();
                    System.out.println("inside the method of all paths");
                    if(li.hasNext())
                         if(li.next().toString().contains("\\Java\\jdk1.5.0_08\\bin\\java.exe"))
                         System.err.println(somepath+"this is the path i wanted to resolve correctly");                         
                         return true;
                         else{
                              System.out.println("trueeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
                                   return false;
                    else {
                              return false;
     }

A good place to ask advice about web development is at the MozillaZine "Web Development/Standards Evangelism" forum.
*http://forums.mozillazine.org/viewforum.php?f=25
The helpers at that forum are more knowledgeable about web development issues.<br>
You need to register at the MozillaZine forum site in order to post at that forum.

Similar Messages

  • I am looking for Compact RIO system for PID control

    Hi all,
    I am looking for the CompactRIO system for PID control.
    My system acquires two input data (0-10V) from two displacement sensors and sends one output signal (0-10V) to piezo-actuator at every step. And my target is the short settling time and the low overshoot.
    I think that I need fast control system. So I am interested in CompactRIO. But I am not familiar with this sytem. Could you recommend the good control system for me?
    The one important thing is that the time limiting step of my system is Piezo actuator (it's natural freq is 20kHz.) CompactRIO is much faster than the Piezo-actuator. I am not sure whether CompactRIO is good to my system or not.
    Here is the CompactRIO system which I am interested in:
    i) CompactRIO Reconfigurable Embedded System: cRIO-9004
    ii) CompactRIO Reconfigurable Chassis: cRIO-9101
    iii) I/O Module : AI : cRIO-9215 AO: cRIO-9263
    Thank you so much,
    Sungjin

    Hello Sungjin,
    CompactRIO should work great for your PID control system. Those I/O modules are the correct voltage range and the 1M gate FPGA backplane will be plenty for a single PID controller. You'll probably be able to get loop rates around 100kHz for analog PID control.
    Keep in mind that the LabVIEW FPGA module includes PID examples that will cut down your development time considerably.
    Regards,
    Vineet

  • Java program to watch sql server for new data

    I need to write a java program to watch a ms sql server database table, whenever there are data inserted into this table, I need to followup with some functions!
    I have done some jsp work before, but writing a java process that would do watch, i have no idea. any help?
    thankx
    ku

    The only efficient mechanism I can imagine would be to define a trigger on insert and/or update on the table and have this do something (not sure what, don't use MS SQL Server these days).
    Chuck

  • Java Program in Different Operation Systems

    Just one question? can I use a java program (.jar) compiled in windows, in my solaris only by copying the .jar , or do I need to compile it with the solaris SDK?
    Thanks in advance for your help and sorry for my ignorance.
    Javier

    Hi,
    It is not required to recompile bcoz the .jar file contains .class files which are independent of Operating system which will be taken care (interpreted) by JVM.
    Actually there is different JVM's for different operating systems(Windows 98,Unix,OS/2). No need to have differend java class file for different operating system. Pls, remember Java is platform independent language.
    Regards,
    S.Prabu

  • Can a java program run as a system process?

    Hi,
    I need to know if a java program can be run as a system process. I don't want it to be run as a user process. Is there any way at all?

    Tomcat is such a program.
    If you want to write a program that runs like a daemon (Unix) or a Windows service (Windows), use the Jakarta Daemon Framework (no, it is not an Indonesian devil) that was used to write Tomcat. Check http://jakarta.apache.org/commons/daemon/

  • Two entries for every technical system for XI in SLD

    Hi,
    Last weekend we had a patch upgrade in our Production env for SAP PI system.
    After that we got the Cache error (Cache notification from Integration Directory failedError when accessing the System Landscape Directory) in RWB -- "Cache Connectivity Test -> IR -> ID -> Adapter Engines".
    And
    In SLD->Technical Systems->all (Adapter Engine, Integration Directory, Integration Repository, RWB).
    e.g.:There are two Adapter Engines:
    Adapter Engine on p80.p80xxxxx
    and
    Adapter Engine on p80.p80xxxxx\p80
    Our Basis team contacted SAP for help & SAP has suggested as below.
    "We compared the SLD->Technical Systems for QA (Q80) and PROD (P80), and found that for the production box (P80), each XI component is registered Twice.
    Now as per the note 764176, we have to delete the entries in the SLD -> Technical Systems. And these will be re-created after a restart.
    Could you please let us know whether these have been maintained for any special reason or we can go ahead and delete them."
    If you have any idea if those two should be maintained or not, please suggest how to proceed.
    Thank you & Best regards,
    Farooq.

    Hi Farooq,
       I have faced the same issue and got resolved by 764176.
    you can go ahead and implement the note 764176 which will resolve your issue.
    Regards,
    naveen

  • Set up for scan to email for Laserjet pro 300 MFP M 375nw

    I am trying to set up a scan to email on my Laserjet pro 300 MFP M 375 and with my IP for my computer, I get as far as filling out the required forms.  All is well until I have to enter a password.  It will be rejected.  I have forgotten the password I initially used.  I would like to know how I can remedy the situation and insert a new password.  NO one seems to be able to help with this problem

    Greetings , I may be able to help you with renaming your scans. Now, I was not able to find any setting that would automatically increase the scan numbers when using the Scan to Email settings. If you use the Scan to Computer option it will number them the way you are describing; Scan0001, Scan0002, ect... That being said, you are able to manually rename the scan file during the Scan to Email process.When you choose Scan then EmailThen choose you outgoing email profileYou should see a Settings button on the bottom left of the display screenScroll through options and select the one that says FilenameEdit the scan file name using the onscreen keyboard Please let me know if any of these steps resolved your issue, or if there is anything else I can do to help.  I look forward to hearing from you!  Thanks, 

  • Using ARD for scanning remote computers for Virus

    This might be way out, but does anyone know of a unix command or something that can be sent remotely to remove viruses from Mac desktops using ARD. We have a few viruses that although are not effecting our macs are being send to Windows users and they then have to deal with the virus.
    Thanks

    There is no direct command for virus checking in UNIX, so no, not as such unless you know specifically what files needed to be removed in which case standard UNIX rm commands would work. Otherwise you'd have to have a virus application on the Mac that could be run via command line, and I don't know of any unless perhaps ClamXav does (the underlying ClamAV engine is command-line based but I'm not sure if ClamXav still allows access).

  • How do I update the Adobe Inspiration Browser for Mac operating system for Photoshop Elements 10?

    I am unable to update the Adobe Inspiration Browser shown as an option on the first dilog box when I opened Adobe Photoshop Elements 10 for Mac for the first time.  I get an error message indicating an incorrect configeration to accomplish this task.  What am I doing wrong?  Please indicate the exact steps do accomplish this task.

    See if anything here helps (scroll down for mac):
    http://helpx.adobe.com/photoshop-elements/kb/tutorials-displayed-inspiration-browser-photo shop.html

  • Where can I find Firefox for BADA Operating system for Samsung Wave 2 Mobile GT-S8530 Model

    I would like Firefix for my Samsung Wave 2 BADA OS Model GTS-8530 . Please provide it at the earliest with Flash player facility

    Firefox Mobile runs on the Android and Mameo operating systems. We don't have a version that works on BADA OS.

  • Ideas for new Java Program

    I'm looking for some ideas of simple java programs that I can use for a final project at school. Anyone got ideas?
    Thanks, G

    TuringPest wrote:
    Encephalopathic wrote:
    yawmark wrote:
    [Ideas for student projects|http://www.mindprod.com/projects/projects.html].
    Typo. Correct site: [http://www.mindprod.com/project/projects.html|http://www.mindprod.com/project/projects.html]
    "sanity checker" was not as cool as it sounded.
    i imagined some sort of luscher color test + response time checker psychological monitoring system.that wouldn't be nice for the kids as it would give them unexpected (to them) output when they ran it on themselves...

  • Process name representation in a LINUX machine for a JAVA program running..

    Hi,
    We are using an Intel machine loaded with Red Hat Linux 7.2 OS to run JAVA programs. We have a requirement to calculate the CPU and MEMORY usage for each JAVA program running. Unfortunately when a java program is run say "java ESR" and we run a ps -ef | grep -i java, it is shown as hkumar 2847 2799 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2874 2847 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2875 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2876 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2877 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2878 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2879 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2880 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2881 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2882 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2883 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2884 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    hkumar 2885 2874 0 19:15 pts/3 00:00:00 /usr/java/jdk1.3.1_03/bin/i386/n
    instead of the actual name of the program ie. ESR.
    Does anybody know why this happens? Is there a way out to ensure that "ps -ef | grep java" gives the actual name of the java program being RUN?
    Thanks in advance,
    Harish

    You have less chance to identify which programm that VM instance is running right now.
    But you could (as we do) keep track of your programs if you save the process-id when you start the program.
    We need this to shut down running java batch programs but you could find out the used system resources with this way as well...

  • How to create reports for java programs?

    Hi,
    I have planned to do a project using java,that will help to create reports for java programs. To create reports for java programs i used two options.
    1)Crystal reports
    2)Write the code to produce reports for each java programs
    The second one little cumbersome.SO i planned to develop a software that is compatible for creating java reports.
    I would like to know how i will do the project?Can you help me to made it a successful project.Hope you can help me.
    Expecting your reply
    PreethiRenjith

    Uggg... Crystal reports...
    I would personally write a generic report generator, It would probably be easier than fighting w/
    crystal reports (CR is popular, but painful :) )
    Anyhow, I've written report generators for many different applications. It is one of the simplest projects you
    can take on, and the results make you feel special --
    If your need nicely formated, portable, printable reports, you could have your report generator make PDF files (the format is open, and VERY simple, plus people like pdf files) you can get the pdf spec from adobe or from wotsit.org (the famous wotsit file format archive).
    enjoy!

  • HELP for Compile java programe !

    Hello All,
    i want to make java programe by which i can compile java programes
    and when i compile java programe from my programe then
    i shoul get compiled status means programe compile successfuly
    or not compile.
    if any example i m thanksfull.
    onlyforjava.

    how about if compile fail?
    the process obj seems return value 0 as it run successful.
    I haven't try this, but I have experienced the process obj returns 0 if the executed command has some routine to handle error cases, in which, error will not halt the system.
    So, I recommand the following scenario.
    1. let say, if your java is test.java. check the existence of file test.class.
    If, it exists, get its modified time.
    2. compile the java code with
    Procress p = Runtime.exec(new String[]{"javac", "test.java"});
    3. get the error string if any.
    InputStream in = new BufferedInputStream(p.getInputStream());int read;while ((read = in.read()) != -1){  System.out.println((char)read);}
    4. handle error with the exitValue
    if (p.exitValue() != 0){  System.out.println("warning.");}
    5. check again the file test.class if it is a newly created file.
    6. if it is newly created, compile success. Else, failed.

  • How do we do TypeMapping for Vector, Hashtable, or any java data structure in RPC?

    I tried to implement a dynamic Client (RPC) however I got the following Error
    when I ran the program.
    Exception in thread "main" java.lang.ClassCastException
    Here is my part of code
    //create service
    Service service = factory.createService( serviceName );
    TypeMappingRegistry registry = service.getTypeMappingRegistry();
    TypeMapping mapping = registry.getTypeMapping(
    SOAPConstants.URI_NS_SOAP_ENCODING );
    mapping.register( Vector.class,                          
              new QName( targetNamespace, "Vector" ),      
              new language_builtins.util.VectorCodec(),                         new language_builtins.util.VectorCodec()
    //create call
    Call call = service.createCall();
    //set port and operation name
    call.setPortTypeName( portName );
    call.setOperationName( operationName );
    call.addParameter( "string",new QName( "http://www.w3.org/2001/XMLSchema","string"
    ParameterMode.IN);
    call.addParameter( "intVal",new QName( "http://www.w3.org/2001/XMLSchema","int"
    ParameterMode.IN);
    call.setReturnType( new QName( targetNamespace, "Vector" ) );
    Vector v = (Vector) call.invoke(new Object[] {"Hi", new Integer(1) });
    Any help on this will be greatly appreciated.
    december

    Hey December,
    I looked at your WSDL, but it doesn't give any hint of what you are putting in
    the LinkedList or Vector. All it says is that an "array of anything" (basically,
    an array of java.lang.Object) is returned from the buy and sell web service operations.
    Surely there is some complexType (i.e. TradeResults, TransactionResults, etc.)
    that you want to return here. A java.util.LinkedList object is not a complexType.
    It's a generic container object which is specific to the Java programming language.
    Same with the java.util.Vector. Web services are programming language independent,
    so a .NET client (written in C# or VB code) wouldn't really know how to deal with
    a java.util.LinkedList, right? Web services do not transfer objects back and forth,
    just XML. This means that the buy web service operation doesn't really return
    a java.util.Vector over an HTTP connection. It returns an XML representation of
    the "hierarchical state" associated with the complexTypes you put in the Vector,
    inside the "service implementation" code on the server side.
    What you want to do is use the WSDL "to describe" the data types your web services
    accepts and returns. To do this, you'll need to define complexTypes to put in
    the array of complex types that is returned. If you leave things as they are,
    I don't think you'll ever be able to determine what's in "the Vector". Again,
    this is because web services don't transfer objects back and forth, just the state
    that is used to instanciate them :-)
    HTH,
    Mike Wooten
    "december_i" <[email protected]> wrote:
    >
    >
    >
    Hi Michael Wooten,
    When I printed out the Object class name, it returned this "[Ljava.lang.Object;"
    So I tried this way again.
    Object[] obj = (Object[])call.invoke(new Object[] {"Hi", new Integer(1)});
    System.out.println("obj[0].getClass().getName()=" + obj[0].getClass().getName());
    At this time, it printed this "java.lang.String".
    I guess web services is not returning Vector.
    I attached my WSDL file.
    I really appreciated your help.
    best wishes,
    December
    "Michael Wooten" <[email protected]> wrote:
    If you are still getting a class cast exception, maybe it's becausethe
    web service
    isn't returning a Vector.
    Change the following line in your client code:
    Vector v = (Vector) call.invoke(new Object[] {"Hi", new Integer(1)});
    to:
    Object obj = call.invoke(new Object[] {"Hi", new Integer(1)});
    System.out.println("obj.getClass().getName()=" + obj.getClass().getName());
    That way you can see what the return type is :-)
    You might want to post the WSDL and remote interface of the web service
    you are
    trying to call also.
    Regards,
    Mike Wooten
    "december_i" <[email protected]> wrote:
    Hi Mike Wooten,
    Thanks for pointing out my mistake.
    However I'm still getting same error. I know i'm gettting this error
    because of
    return type "Vector". But I don't know what I did wrong.
    Does anybody have any sample example about TypeMapping for any datastructures?
    Any help on this will be greatly appreciated.
    December
    "Michael Wooten" <[email protected]> wrote:
    Hi December_i,
    Your code is saying that the "Vector" type is in the target namespace
    for your
    web service. I don't think this is correct. Try this:
    mapping.register(
    java.util.Vector.class,                          
    new QName("java:language_builtins.util", "Vector" ),      
    new language_builtins.util.VectorCodec(),
    new language_builtins.util.VectorCodec()
    call.setReturnType( new QName("java:language_builtins.util", "Vector"
    HTH,
    Mike Wooten
    "december_i" <[email protected]> wrote:
    I tried to implement a dynamic Client (RPC) however I got the following
    Error
    when I ran the program.
    Exception in thread "main" java.lang.ClassCastException
    Here is my part of code
    //create service
    Service service = factory.createService( serviceName );
    TypeMappingRegistry registry = service.getTypeMappingRegistry();
    TypeMapping mapping = registry.getTypeMapping(
    SOAPConstants.URI_NS_SOAP_ENCODING
    mapping.register( Vector.class,                          
              new QName( targetNamespace, "Vector" ),      
              new language_builtins.util.VectorCodec(),                         new language_builtins.util.VectorCodec()
    //create call
    Call call = service.createCall();
    //set port and operation name
    call.setPortTypeName( portName );
    call.setOperationName( operationName );
    call.addParameter( "string",new QName( "http://www.w3.org/2001/XMLSchema","string"
    ParameterMode.IN);
    call.addParameter( "intVal",new QName( "http://www.w3.org/2001/XMLSchema","int"
    ParameterMode.IN);
    call.setReturnType( new QName( targetNamespace, "Vector" ) );
    Vector v = (Vector) call.invoke(new Object[] {"Hi", new Integer(1)
    Any help on this will be greatly appreciated.
    december

Maybe you are looking for

  • Captivate 6 playbar lock

    Hi I have a project that I would like the next/forward button inactive until the slide has finished. There is a widget out there that hides the next button until slide has finished, this is exactly what I need except that it does not work with Captiv

  • Sharepoint as Content Server

    Hello, I am trying to connect Sharepoint as Content Server in SAP. I have already read about a third party product from E.link to be able to do this. I also read about Duet. I dont know if Duet allows this integration. Another option I have read is t

  • MD player for Mac - to use with  Garageband

    Hi, could someone suggest a good MD player that is compatible with Mac. I´ve heard that the Sony MZ-RH10 that can transfer data through USB doesn´t work so well. So I´m thinking of buying a cheeper MD player (without the USB transfer possibility) and

  • Probl launch multiple swing app in the same vm

    Hello, I lauch multiple swing applications in the same vm ; my problem is that applications launched are not isolated : shared look and feel only one modal dialog box can be shown is there a way to isolate applications ? thanks.

  • Parallel port sample rate

    Hi, I`m desperately in need of your help. For my school project, I`m trying to write a labview code in order to acquire air pressure data by using 8-bit analog digital converter via parallel port. Although my signal frequency very low -100 Hz-I think