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...

Similar Messages

  • Execute a script in a Linux machine from a Java application

    Hi,
    I am trying to execute a script in a Linux machine from a Java application on a Windows environment. My code is
    commande="rsh 185.30.30.30 -l goku /newfolder/bench/bin/Agent start ";
    try{
    Process process = Runtime.getRuntime().exec(commande);
    catch(Throwable t){}
    It works fine but the script takes too much time to start (almost 3 minutes). My question is there exists anther way to execute the script, another command? I have already tried ssh but windows doesn�t recognize it
    If somebody has any idea please let me know...
    Thanks

    The script starts and stops a process (Agent) so it doesn�t take too much time to execute itself. It is when I execute the script from my java program that i must wait to watch my process running in my Linux server.

  • How can i create a test suite in oracle for a java program

    hi
    i have to create a table for test cases for a java program
    in that my main concentration is on branch statements
    i have problems to choose which fields should be there in my table
    plz let me know if you have nay ideas
    thnx
    regards
    [email protected]

    no idea based on the little or nothing you've posted.
    %

  • Currently running process name list and local port list display using java

    HI
    I have for truble to display Process name list and that process running local port number...
    like this output from java
    process localport
    ======= ========
    ccApp 1096
    orbd 1050
    postmaster 5432
    skype 443
    MSTask 1051
    can help any one with sample code Explain sample code wtih , this thread or . if you found sample code please send me [email protected]
    Best Regards
    P.SASIKUMAR

    If it's possible for C++ ,. can you give me the best sample and how to interact to java todisplay this result....

  • Java program runs differently on Windows and Linux

    Hi!
    I would like to run a java application (which is written and run on windows platform) on linux platform. I don't know wether it is possible or not, but I tired on the following way:
    I have made a small java application. It worked correctly on windows (I developed it on windows). I copied first only the class file (Start.class) to the linux machine (which has exactly the same JDK as windows machine). When I type the command:
    java Startit gives me the folloving error:
    Exception in thread "main" java.lang.ClassFormatError: Start (unrecognized class file version)
       at java.lang.VMClassLoader.defineClass(libgcj.so.7rh)
       at java.lang.ClassLoader.defineClass(libgcj.so.7rh)
       at java.security.SecureClassLoader.defineClass(libgcj.so.7rh)
       at java.net.URLClassLoader.findClass(libgcj.so.7rh)
       at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.7rh)
       at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
       at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
       at gnu.java.lang.MainThread.run(libgcj.so.7rh)After that I was trying to compile the source file on linux with the command:
    javac Start.javabut the compiler gave me an error in the source file.
    Is there any way to run the formerly written java application (on windows) on linux machine?
    Thanks

    When I type the command java-version I get the following:
    java version "1.4.2"
    gij (GNU libgcj) version 4.1.2 20080704 (Red Hat 4.1.2-46)
    Copyright (C) 2006 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.The JDK on linux and windows is the latest (I was download it today).
    How can I upgrade the jdk/jre on linux?
    Here is the compiler error:
    [root@Linux-oracle app]# javac DataMining.java
    1. ERROR in DataMining.java (at line 77)
            ArrayList<String> temp = new ArrayList<String>();
            ^^^^^^^^^
    The type ArrayList is not generic; it cannot be parameterized with arguments <String>
    2. ERROR in DataMining.java (at line 77)
            ArrayList<String> temp = new ArrayList<String>();
                      ^^^^^^
    Syntax error, parameterized types are only available if source level is 5.0
    3. ERROR in DataMining.java (at line 77)
            ArrayList<String> temp = new ArrayList<String>();
                                         ^^^^^^^^^
    The type ArrayList is not generic; it cannot be parameterized with arguments <String>
    4. ERROR in DataMining.java (at line 77)
            ArrayList<String> temp = new ArrayList<String>();
                                                   ^^^^^^
    Syntax error, parameterized types are only available if source level is 5.0
    5. WARNING in DataMining.java (at line 240)
            String youtube[][] = new String[20][5];
                   ^^^^^^^
    The local variable youtube is never read
    6. WARNING in DataMining.java (at line 267)
            int e;
                ^
    The local variable e is never read
    7. ERROR in DataMining.java (at line 329)
            for(int i=1;i<Video+1;i++)
                          ^^^^^^^
    The operator + is undefined for the argument type(s) Integer, int
    7 problems (5 errors, 2 warnings)

  • Making a java program run in Windows and Linux via web applets

    Hello, this is my first post at java.sun.com
    I made an application in Linux, using Jbuilder Fundation 2005. I used the JDBC MySQL connector for Linux, and I used Mandriva as a distro. What I did is a program that allows me to connect remotely to my server, in order to update the news.
    However I want to create an applet, in which you could click a button, and the main frame of the program will load. I have no idea how to do this, since this program runs great on my linux machine, and from what I know it uses the MySQL JDBC jar that's installed on my machine, and a lot of classes from the Jbuilder program directory.
    How could I upload this program to a webpage (with the applet idea that I mentioned earlier) so that both Linux and (especially) Windows clients could use it?
    It will also be nice to know how to create a .jar file that has all of the required classes in it, I know that Jbuilder enterprise does this, but I don't have that version or plan buying it.
    Thanks in advance

    Put the jre folder from your JDK install in your app folder.ok, but in this way he doesn't have to download jre
    but I have to add it to the app folder so that an
    application large just some kilobytes would become
    some megas bigger... unless I have misunderstood what
    you're suggesting me of course.Yeah, that's the downside. However, 17 MB isn't very large by todays standards.
    jre\javaw -cp <your classpath> <your main class><your classpath> is the class i need to be run's path
    or my classpath?
    jre\javaw has to be written like this or preceeded by
    the path of jre directory?As long as you point 'start in' to the correct directory, I don't believe you have to worry about that. That path you have there isn't quite right (neither was mine) but I think you've got that under control.
    You can give anm explicit path, then you can have different users with different start-in values and store their properties there automatically.

  • Installer for a Java Program

    Hello, folks.
    I've written an application that I feel is ready to show to others, and would like to provide it with an installer.
    I need to check that JRE 1.4 is installed, install it if it isn't, install the application to a directory, set install/uninstall options in the control panel, and add a start menu item. (This will be a Windows-platform installer.)
    Could any of you suggest a free (not demo) installer system that I could use? I've heard that there are some good ones out there, but I don't have their names and associated URL's.
    thanks,
    Andrew

    Hello All,
    This is may be bit of a tangent, but hopefully it can be helpful regardless...
         I'm looking into installer programs that are java friendly with the ability to generate a gui-based install program for multiple platforms. I went out and tried to find as many programs that match these specs (list below). Before I dive headlong into demo-sampling-mode - I was hoping folks would share any positive or negative experiences they've had with any of the apps listed below.
    http://www.denova.com/ - DeNova
    http://www.fawcette.com/Archives/premier/mgznarch/javapro/2000/06jun00/rv0006/rv30006.asp - InstallShield Java Edition 3.0
    http://www.alphaworks.ibm.com/tech/beanbag - BeanBag
    http://www.alphaworks.ibm.com/tech/installtoolkit - Install Toolkit for Java
    http://www.jadcentral.com/codecentral/code_profile.jsp?category_ID=4&code_ID=112 - ITW Installer For Java Applications
    http://www.zerog.com/ - InstallAnywhere (some free, some not)
    http://www.gjt.org/info/design/autorad.shtml - AutoRad [GPL]
    http://www.xenonsoft.demon.co.uk/products/freeinstaller/index.html - freeinstaller [Open Source]
    http://www.izforge.com/izpack/ - IzPack [Open Source]
    http://www.toolshed.com/download/installer/install.html - Java Self Installer [GPL]
    http://liftoff.sourceforge.net/ - Lift-Off [GPL]
    http://packlet.sourceforge.net/ - Packlet installer tool [Open Source, LGPL]
    http://vainstall.sourceforge.net/ - VAInstall [GPL]
    Comparisons:
    http://www.zerog.com/products_pu_05.html
    Cheers,
    Enrique
    cc comp.lang.java.softwaretools
    cc forum.java.sun.com > Java Programming > Installer for a Java Program

  • How to create a batch file for a java program?

    I have a java project in JCreator and the project is organised into packages. I have also configured JCreator to provide 2 arguments to the main method when the project is executed.
    I would want to create a batch file (.bat) for this project where the batch file can automatically use the arguments set in JCreator when the program runs.
    How do I go about creating the batch file?

    where the batch file can automatically use the arguments set in JCreatorThat all depends JCreator... can you get those arguments somehow?

  • 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.

  • 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/

  • 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...

  • How to install HTTP Server in a Linux Machine for running APEX

    I've Installed Unbreakable Linux 4.7 and I'm using the standard apache which comes (Apache 2), I want to install the HTTP Server in order to run APEX on this machine, and may it look the data from the database which is oracle 10g (The database is on another machine). Could both installations of apache and Oracle http server co-exists and what is the best form to do it??

    Yes, they can. They installed in different directories and you have to use different ports.
    AFAIK for HTTP for APEX is either part of the installation (eg. in the Oracle Express Edition) or part of the Oracle Installation CDs. For more information see the Oracle Installation Documentation.
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • 100 % free domain name and 2000 mb  linux hosting for one year

    As I said for the first time I didn’t believe I thought
    it was one those internet scams
    But here im having two domain names and one year of web
    hosting 2000 mb 50000 mb
    bandwidth linux hosing . 100% didn’t pay anything just
    ask an American friend to answer few
    savories for me ,When she have a free time , cause the offer
    is limited just for US resident .
    And u know always there are a backdoor just ask any American
    friend ( if u are not ) to answer
    those savories for u And here u are u got a domain name
    registered in ur name for one yeah and
    after that year u will be warned to answer few more savories
    if u wanna keep the domain
    name and the web hosting for another year .
    its easy free and real cause im starting my own online
    business with that web hosting and domain
    name and with the highest quality DNS for the domain name and
    a full feature control panel CP
    as for the web hosting , u can make sure that by ur self
    right now just visit those link register
    and start answering the savories to get ur own web hosting
    and domain name .
    free web hosting and domain name :
    http://www.dietzel.com/partner/idevaffiliate.php?id=393_7
    Free domain name :
    http://www.dietzel.com/partner/idevaffiliate.php?id=393_6
    Free domain name :
    http://www.dietzel.com/partner/idevaffiliate.php?id=393_5
    And this is the website im running right now , using the
    domain name and web hosting I have got for free :
    http://bc-classifieds.net/
    and
    http://valhallarealm.com

    As I said for the first time I didn’t believe I thought
    it was one those internet scams
    But here im having two domain names and one year of web
    hosting 2000 mb 50000 mb
    bandwidth linux hosing . 100% didn’t pay anything just
    ask an American friend to answer few
    savories for me ,When she have a free time , cause the offer
    is limited just for US resident .
    And u know always there are a backdoor just ask any American
    friend ( if u are not ) to answer
    those savories for u And here u are u got a domain name
    registered in ur name for one yeah and
    after that year u will be warned to answer few more savories
    if u wanna keep the domain
    name and the web hosting for another year .
    its easy free and real cause im starting my own online
    business with that web hosting and domain
    name and with the highest quality DNS for the domain name and
    a full feature control panel CP
    as for the web hosting , u can make sure that by ur self
    right now just visit those link register
    and start answering the savories to get ur own web hosting
    and domain name .
    free web hosting and domain name :
    http://www.dietzel.com/partner/idevaffiliate.php?id=393_7
    Free domain name :
    http://www.dietzel.com/partner/idevaffiliate.php?id=393_6
    Free domain name :
    http://www.dietzel.com/partner/idevaffiliate.php?id=393_5
    And this is the website im running right now , using the
    domain name and web hosting I have got for free :
    http://bc-classifieds.net/
    and
    http://valhallarealm.com

  • Issue with creation of a specific field for a java program.

    Hey everyone,
    This is homework which is end of chapter "challenges" to practice what we've learnt.
    The chapter covers inheritance (super class and all things related)
    I'm having quite an annoying issue with the very beginning of the instructions, where it tells me to make the following fields:
    - Employee name
    - Employee number in the format XXX-L , where each X is a digit within the range 0-9 and the L is a letter within the range A-M.
    - Hire date
    This is what I wrote for code so far
    private String name;
    //private WTF
    private String date;I really have no idea what to do for the second field, how to even constrain integers and letters in the same field with a rule for number range and letter range, and that for each character independently, for what I understand.
    Any advice with this? It's blocking me from continuing -_-, because I can't make accessors and mutators and constructors, etc, if i'm still unsure of how the fields unfold.
    Thanks in advance.

    You can create a HireDate class.
    public class HireDate{
       private final int day;
       private final String month;
       private final int year;
       public HireDate(int day, String month, int year){
          this.day = day;
          this.month = month;
          this.year = year;
    }In the HireDate Constructor you could put if statements to ensure that only correct information is present. The fields are final because the hire date will not change. Override the toString() method so that when you print it out it will be in the correct format. Create some getter methods to get the private fields.
    Then in your other class just do this
    HireDate hired = new HireDate(10, July, 1991);Now you have an object that stores all 3 fields for you. You can use the object as you like and when it prints it will be in the format you want.
    Or you could just make hireDate a String variable. That is what I always did and I never lost marks for it. The reason I suggest this way is because you mentioned rules and constraints.

  • Creation of a .exe file for a Java program

    hi, myself is venu.
    Can anyone help in creating a .exe file for a generated .class file.
    Thanking you in advance.
    bye

    Hello,
    There is a tool that you can download called JavaExe. It will make an executable of your java class. The class must have a main method. Just google for it and follow the instructions. I have tried it, it does work well.
    delaware_samurai

Maybe you are looking for

  • I would like to upgrade my Macbook Pro Model A1278.

    Hi, I would like to upgrade RAM and hard drive memory on my Macbook Pro Model A1278, but I'm not sure what is the maximum RAM I can install and what is the maximum hard drive memory I can install if its even doable. Also, which are the parts I should

  • What does it take to use an iphone 5 in Europe?

    I live in the US and am going to Italy in a few weeks (just for 10 days or so) and I have just purchased an Iphone 5 with a data plan (not interrnational plan). I was told once in Italy it would work if I go under 1. general settings 2. hit roaming o

  • BW Upgrade "Execute the conversion programs for the product master "

    Hi BW Gurus,                     We are in the process of upgrading BW 3.5 to BW 7.0. We did not get any conversion error in BW Dev but in BWQ we got error in one of ABAP program. The error message in log is :- "Value '######' of characteristic 0TIME

  • Trouble when importing tagged text (CS6)

    I'm trying to import a tagged .txt file into InDesign however when I do, the paragraph styles are not recognized and I end up with unformatted text. Is there a certain format the .txt file needs to be in (unicode 8, 16 etc.)? Any help would be apprec

  • Lookup using dimension variable

    Hi All, I am having as logic script that does a lookup for two Accounts in another application: *LOOKUP CHARGEABILITY *FOR %LOOP_ACCOUNT_CHARGEABILITY% = TARGET_UTILISATION,TARGET_DAY_RATE *DIM %LOOP_ACCOUNT_CHARGEABILITY%:ACCOUNT = %LOOP_ACCOUNT_CHA