Tracing a java program execution

Hello. I would like to know which classes of a java archive (jar) are executed when i execute an application. Is there an easy utility to do this?
There's an application running on a server. I would like to know which class is called first when a tcp client is connection to the server...
Thank you for your help, it's very very important.
Wardem fury - Paris.

thank you. i thought that the java language had some specific modules to automatically trace a java program execution....
anyway, thank you.

Similar Messages

  • Need help in java program execution...

    Hi all
    I have made a java program( JAR file) and I need to execute it from a double click...can you please tell how to do it..For normal execution i have to go to CMD prompt and write a couple of commands but i want to execute it through 1 click..
    The method which i thought was to make a batch(.bat) file and write the commands in it but its not working properly...do you have any other method or software which i can use...
    I am new to java and any help would be appreciated.

    You should avoid using a batch file since there's no explicit reason to do that.
    sachinmittal wrote:
    I have made a java program( JAR file) and I need to execute it from a double click...can you please tell how to do it.There a lot of tutorials out there. I prefer this one:
    [http://java.sun.com/docs/books/tutorial/deployment/jar/index.html]
    You should take look at the manifest section if you want to build an executable jar.

  • The system variables in java, NEEDED ONLY at CLI execution of java programs

    The system variables in java, NEEDED ONLY at CLI execution of java programs, and NOT needed at all[essentially] if I install bundle(14+6.7)?
    if I install bundle(14+6.7) to run-test a web app with netbeans 6.7 what I must press, then opens the default browser? I have to be online,...? How I test browse my project?

    Probably a complete tutorial on all possible environment variables in addition to a tutorial on netbeans configuration.

  • Compiling .java files during program execution.

    I have a program that read events in from a file and creates custom Event objects (which extend Thread) from this information, and then later the events are activated depending on the timing information that was provided in the file. Everything works great however, I would like to add the ability to include custom Events in the file that the events are read from. I would like the program to take that java code information and produce a class file that can be used during the programs execution. What classes can help me do this and are there any examples that anybody knows of, of something like this?

    I wonder if anyone has ever tried to do this before...
    http://onesearch.sun.com/search/developers/index.jsp?col=devforums&qp_name=Java+Programming&qp=forum%3A31&qt=dynamic+compilation+compile+runtime

  • How Can we stop the execution of java program which contain infinite loop

    Dear All,
    I create one .bat file which which execute the simple java program
    I write one java program which execute above .bat file using instance of Runtime Class of java
    It's work fine if java program which is executed by .bat file is simple(Which has normal termination)
    But if that program contain inifinte loop then that file will goes on executing untill I close it manually
    So i want a solution in java which close that bat file (command window ) which is in running condtion
    If there any solution please replay me
    I try to close that .bat file using destroy() ,stop() method of Process and Runtime , Thread Class
    but it did not give me correct output
    .bat file still running !!!!!!!!!
    Thanks in advance

    Why not use javaw.exe to make the app run so you don't need the dos window (which is presumably what you are actually talking about when you say bat file).

  • Java Card program execution on Eclipse

    Hi Dears,
    I am new to Java Card. I did setup to run Java Card programs on eclipse using http://eclipse-jcde.sourceforge.net/.
    This is my simple program below
    import javacard.security.RandomData;
    public class Main {
         public void main() {
              RandomData rd = RandomData.getInstance(RandomData.ALG_SECURE_RANDOM);
              short outLen = 10;
              byte buffer[] = new byte[outLen];
              short outOffset = 0;
              rd.generateData(buffer, outOffset, outLen);
    Compilation is successful but when I run the program I get the following error.
    Error occurred during initialization of VM
    java/lang/NoClassDefFoundError: java/lang/String
    This is very annoying. I think my run time environment is not ok for running java card programs. I am able to run Java programs but not java card programs. Any one can help please?
    Thanks,
    Regards,
    Naveed

    please post code with {code} tags
    Naveed86 wrote:
    Hi Dears,
    I am new to Java Card. I did setup to run Java Card programs on eclipse using http://eclipse-jcde.sourceforge.net/.
    This is my simple program below
    import javacard.security.RandomData;
    public class Main {
         public void main() {
              RandomData rd = RandomData.getInstance(RandomData.ALG_SECURE_RANDOM);
              short outLen = 10;
              byte buffer[] = new byte[outLen];
              short outOffset = 0;
              rd.generateData(buffer, outOffset, outLen);
    }Compilation is successful but when I run the program I get the following error.
    Error occurred during initialization of VM
    java/lang/NoClassDefFoundError: java/lang/String
    This is very annoying. I think my run time environment is not ok for running java card programs. I am able to run Java programs but not java card programs. Any one can help please?
    Thanks,
    Regards,
    Naveed

  • Challange for you, help for me! java program

    I am a beginning java student and desparately (again) in help of someone who will check my java program. See below what they want from me, and try to make a program of it that works in all the ways that are asked. Thank you for helping me, i am running out of time.
    Prem Pradeep
    [email protected]
    Catalogue Manager II
    Specification:
    1.     Develop an object to represent to encapsulate an item in a catalogue. Each CatalogueItem has three pieces of information: an alphanumeric catalogue code, a name, and a price (in dollars and cents), that excludes sales tax. The object should also be able to report the price, inclusive of a 15% sales tax, and the taxed component of the price.
    2.     Data input will come from a text file, whose name is passed in as the first command-line argument to the program. This data file may include up to 30 data items (the program will need to be able to support a variable number of actual items in the array without any errors).
    3.     The data lines will be in the format: CatNo:Description:Price Use a StringTokenizer object to separate these data lines into their components.
    4.     A menu should appear, prompting the user for an action:
    a.     Display all goods: this will display a summary (in tabulated form) of all goods currently stored in the catalogue: per item the category, description, price excluding tax, payable tax and price including tax.
    b.     Dispfay cheapest/dearest goods: this will display a summary of all the cheapest and most expensive item(s) in the catalogue. In the case of more than one item being the cheapest (or most expensive), they should all be listed.
    c.     Sort the list: this will use a selection sort algorithm to sort the list in ascending order, using the catalogue number as the key.
    d.     Search the list: this will prompt the user for a catalogue number, and use a binary search to find the data. If the data has not yet been sorted, this menu option should not operate, and instead display a message to the user to sort the data before attempting a search
    5.     Work out a way to be able to support the inc tax/ex tax price accessors, and the tax component accessor, without needing to store any additional information in the object.
    6.     Use modifiers where appropriate to:
    a.     Ensure that data is properly protected;
    b.     Ensure that the accessors and mutators are most visible;
    c.     The accessors and mutators for the catalogue number and description cannot be overridden.
    d.     The constant for the tax rate is publicly accessible, and does not need an instance of the class present in order to be accessible.
    7.     The program should handle all exceptions wherever they may occur (i.e. file 1/0 problems, number formatting issues, etc.) A correct and comprehensive exception handling strategy (leading to a completely robust program) will be necessary and not an incomplete strategy (i.e. handling incorrect data formats, but not critical errors),
    Sample Execution
    C:\> java AssignmentSix mydata.txt
    Loading file data from mydata.txt ...17 item(s) OK
    CATALOGUE MANAGER: MAIN MENU
    ============================
    a) display all goods b) display cheapest/dearest goods
    c) sort the goods list d) search the goods list
    e) quit
    Option: d
    The goods cannot be searched, as the list is not yet sorted.
    CATALOGUE MANAGER: MAIN MENU
    ============================
    a) display all goods b) display cheapest/dearest goods
    c) sort the goods list d) search the goods list
    e) quit
    Option: b
    CHEAPEST GOODS IN CATALOGUE
    Cat      Description      ExTax      Tax      IncTax
    BA023      Headphones      23.00      3.45      26.45
    JW289      Tape Recorder     23.00      3.45      26.45
    MOST EXPENSIVE GOODS IN CATALOGUE
    Cat      Description      ExTax      Tax      IncTax
    ZZ338      Wristwatch      295.00 44.25      339.25
    CATALOGUE MANAGER: MAIN MENU
    ============================
    a) display all goods b) display cheapest/dearest goods
    c) sort the goods list d) search the goods list
    e) quit
    Option: c
    The data is now sorted.
    CATALOGUE MANAGER: MAIN MENU
    ============================
    a) display all goods b) display cheapest/dearest goods
    c) sort the goods list d) search the goods list
    e) quit
    Option: d
    Enter the catalogue number to find: ZJ282
    Cat Description ExTax Tax IncTax
    ZJ282 Pine Table 98.00 14.70 112.70
    CATALOGUE MANAGER: MAIN MENU
    ============================
    a) display all goods b) display cheapest/dearest goods
    c) sort the goods list d) search the goods list
    e) quit
    Option: e
    Here you have the program as far as I could get. Please try to help me make it compact and implement a sorting method.
    Prem.
    By the way: you can get 8 Duke dollars (I have this topic also in the beginnersforum)
    //CatalogueManager.java
    import java.io.*;
    import java.text.DecimalFormat;
    import java.util.StringTokenizer;
    public class CatalogueManager {
    // private static final double TAXABLE_PERCENTAGE = 0.15;
    // Require it to be publicly accessible
    // static means it is class variable, not an object instance variable.
    public static final double TAXABLE_PERCENTAGE = 0.15;
    private String catalogNumber;
    private String description;
    private double price;
    /** Creates a new instance of CatalogueManager */
    public CatalogueManager() {
    catalogNumber = null;
    description = null;
    price = 0;
    public CatalogueManager(String pCatalogNumber, String pDescription, double pPrice) {
    catalogNumber = pCatalogNumber;
    description = pDescription;
    price = pPrice;
    // the mutators must be most visible
    // the final keyword prevents overridden
    public final void setCatalogNumnber(String pCatalogNumber) {
    catalogNumber = pCatalogNumber;
    // the mutators must be most visible
    // the final keyword prevents overridden
    public final String getCatalogNumber() {
    String str = catalogNumber;
    return str;
    // the mutators must be most visible
    // the final keyword prevents overridden
    public final void setDescription(String pDescription) {
    description = pDescription;
    // the accessors must be most visible
    // the final keyword prevents overridden
    public final String getDescription() {
    String str = description;
    return str;
    // If the parameter is not a double type, set the price = 0;
    // the mutators must be most visible
    public boolean setPrice(String pPrice) {
    try {
    price = Double.parseDouble(pPrice);
    return true;
    catch (NumberFormatException nfe) {
    price = 0;
    return false;
    // the accessors must be most visible
    public double getPrice() {
    double rprice = price;
    return formatDouble(rprice);
    double getTaxAmount(){
    double rTaxAmount = price * TAXABLE_PERCENTAGE;
    return formatDouble(rTaxAmount);
    double getIncTaxAmount() {
    double rTaxAmount = price * (1 + TAXABLE_PERCENTAGE);
    return formatDouble(rTaxAmount);
    double formatDouble(double value) {
    DecimalFormat myFormatter = new DecimalFormat("###.##");
    String str1 = myFormatter.format(value);
    return Double.parseDouble(str1);
    public static void main(String[] args) throws IOException {
    final int MAX_INPUT_ALLOW = 30;
    int MAX_CURRENT_INPUT = 0;
    FileReader fr;
    BufferedReader br;
    CatalogueManager[] catalogList = new CatalogueManager[MAX_INPUT_ALLOW];
    String str;
    char chr;
    boolean bolSort = false;
    double cheapest = 0;
    double mostExpensive = 0;
    String header = "Cat\tDescription\tExTax\tTax\tInc Tax";
    String lines = "---\t-----------\t------\t---\t-------";
    if (args.length != 1) {
    System.out.println("The application expects one parameter only.");
    System.exit(0);
    try {
    fr = new FileReader(args[0]);
    br = new BufferedReader(fr);
    int i = 0;
    while ((str = br.readLine()) != null) {
    catalogList[i] = new CatalogueManager();
    StringTokenizer tokenizer = new StringTokenizer(str, ":" );
    catalogList.setCatalogNumnber(tokenizer.nextToken().trim());
    catalogList[i].setDescription(tokenizer.nextToken().trim());
    if (! catalogList[i].setPrice(tokenizer.nextToken())){
    System.out.println("The price column cannot be formatted as dobule type");
    System.out.println("Application will convert the price to 0.00 and continue with the rest of the line");
    System.out.println("Please check line " + i);
    if (catalogList[i].getPrice() < cheapest) {
    cheapest = catalogList[i].getPrice();
    if (catalogList[i].getPrice() > mostExpensive) {
    mostExpensive = catalogList[i].getPrice();
    i++;
    fr.close();
    MAX_CURRENT_INPUT = i;
    catch (FileNotFoundException fnfe) {
    System.out.println("Input file cannot be located, please make sure the file exists!");
    System.exit(0);
    catch (IOException ioe) {
    System.out.println(ioe.getMessage());
    System.out.println("Application cannot read the data from the file!");
    System.exit(0);
    boolean bolLoop = true;
    BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
    do {
    System.out.println("");
    System.out.println("CATALOGUE MANAGER: MAIN MENU");
    System.out.println("============================");
    System.out.println("a) display all goods b) display cheapest/dearest goods");
    System.out.println("c) sort the goods list d) search the good list");
    System.out.println("e) quit");
    System.out.print("Option:");
    try {
    str = stdin.readLine();
    if (str.length() == 1){
    str.toLowerCase();
    chr = str.charAt(0);
    switch (chr){
    case 'a':
    System.out.println(header);
    System.out.println(lines);
    for (int i = 0; i < MAX_CURRENT_INPUT; i++){
    System.out.println(catalogList[i].getCatalogNumber() + "\t" +
    catalogList[i].getDescription() + "\t" +
    catalogList[i].getPrice() + "\t" +
    catalogList[i].getTaxAmount() + "\t" +
    catalogList[i].getIncTaxAmount());
    System.out.println("");
    break;
    case 'b':
    System.out.println("");
    System.out.println("CHEAPEST GOODS IN CATALOGUE");
    System.out.println(header);
    System.out.println(lines);
    for (int i = 0; i < MAX_CURRENT_INPUT; i++){
    if (catalogList[i].getPrice() == cheapest){
    System.out.println(catalogList[i].getCatalogNumber() + "\t" +
    catalogList[i].getDescription() + "\t" +
    catalogList[i].getPrice() + "\t" +
    catalogList[i].getTaxAmount() + "\t" +
    catalogList[i].getIncTaxAmount());
    System.out.println("");
    System.out.println("MOST EXPENSIVE GODS IN CATALOGUE");
    System.out.println(header);
    System.out.println(lines);
    for (int i = 0; i < MAX_CURRENT_INPUT; i++){
    if (catalogList[i].getPrice() == mostExpensive) {
    System.out.println(catalogList[i].getCatalogNumber() + "\t" +
    catalogList[i].getDescription() + "\t" +
    catalogList[i].getPrice() + "\t" +
    catalogList[i].getTaxAmount() + "\t" +
    catalogList[i].getIncTaxAmount());
    System.out.println("");
    break;
    case 'c':
    if (bolSort == true){
    System.out.println("The data has already been sorted");
    else {
    System.out.println("The data is not sorted");
    break;
    case 'd':
    break;
    case 'e':
    bolLoop = false;
    break;
    default:
    System.out.println("Invalid choice, please re-enter");
    break;
    catch (IOException ioe) {
    System.out.println("ERROR:" + ioe.getMessage());
    System.out.println("Application exits now");
    System.exit(0);
    } while (bolLoop);

    One thing you're missing totally is CatalogueItem!! A CatalogueManager manages the CatalogueItem's, and is not an CatalogueItem itself. So at least you have to have this one more class CatalogueItem.
    public class CatalogueItem {
    private String catalogNumber;
    private String description;
    private double price;
    //with all proper getters, setters.
    Then CatalogueManager has a member variable:
    CatalogueItem[] items;
    Get this straight and other things are pretty obvious...

  • How can I run other programs using java program

    hi experts,
    I am trying to execute a set of commands from java program
    eg: from command prompt
    java CommandExecutor c:\winnt\notepad.exe c:\some.exe c:\onemorecommand.exe
    and inside the CommandExecutor main method..
    public static void main(String []arg)
    for(i = 0; i < arg.length; i++)
    Runtime.getRuntime().exec(arg(i));
    the above code is executing all the command one after the other, but I want to execute the above commands squentially, i.e I want to execute the second command only after finishing the first command and the third after finishing the second and so on depending upon the arguments passed, how can I acheive this...
    I have tried to use the Process which is returned by the exec(arg) method but the exitValue() returns same value before execution and after execution.
    thanks,
    krishna

    Did you try to get the process returned and then try
    process.waitFor() method. This waits for the process to finish.
    After that try the next execution

  • Help needed in running a  java program

    hi
    how to run a java program using another java program.
    i have tried a litte to run the notepad,mspaint applications sucessfully using the Runtime class,but how to specify a java program init . the program is given below
    public class cls
    public static void main(String args[])
      Runtime r=Runtime.getRuntime();
      Process p=null;
      try{
        p=r.exec("notepad" );}
        catch(Exception e) {
        System.out.println("error on execution");
    }to run another java program how to modify the exec() or any other way to do this.

    thank u
    its working without any error but it doesn't print any thing on the screen.
    the program is
    this program to be run by cls.java
                                             // hello.java
    import java.io.*;
    public class hello
    public static void main(String[] args)
        System.out.println("hello world");
      }cls.java is given below
                                                    //cls.java
    public class cls
    public static void main(String args[])
      Runtime r=Runtime.getRuntime();
      Process p=null;
      try{
        p=r.exec("java  hello" );}
        catch(Exception e) {
        System.out.println("error on execution");
    }

  • "at" UNIX Command in Java Program

    Friends,
    1. "at" command in UNIX execute Unix command at a scheduled time. 2. For each user there will be a table maintained internally which can be accessed by "at" with "-l" argument.
    3. A mail will be sent to the owner with the output of the commands as a message.
    I tried to run the "at" command of Unix in JSP, which gets succesfully executed in Oracle 10g App Server container (Installed in Solaris machine). I have tested the successful execution of command with the log file. But I haven't got any mail for the output. If anyone had any idea, please help me.
    The code I have wtitten is
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec(new String[] {"sh","-c","at 2115 Dec 7 < /export/home/usr1/abc.sh"});
    InputStream stderr = proc.getErrorStream();
    InputStreamReader isr = new InputStreamReader(stderr);
    BufferedReader br = new BufferedReader(isr);
    String line = null;
    logger.info("<ERROR>");
    while ( (line = br.readLine()) != null)
    logger.info(line);
    logger.info("</ERROR>");
    int exitVal = proc.waitFor();
    logger.info("Process exitValue: " + exitVal);
    My doubts are:
    1. Who is the owner of the output of "at"command, which gets executed under Oracle 10g App Server container?
    2. If no one is the owner, then where will the output of "at" command will go?
    3. Is there any other way to execute "at" command of UNIX in java program? If so, then please help me.
    Thanks in advance.
    regards
    Nandha Kumar.M

    filestream I have to ask - what's a chav ?
    I have doubts abut what it is :-)
    Seriously though, what is that an abbreviation for?
    That's a new one to me.
    http://www.chavscum.co.uk
    chavs are roughly analogous to rednecksI wouldn't use that analogy. While both may lack certain social graces, rednecks typically don't receive ASBOs.
    Chavs favor small cars with lots of bling whereas rednecks are likely to drive a pickup or a large sedan.
    Chavs have pitbulls in their yards (gardens), rednecks an '84 Mustang LX on cinder blocks.
    etc, etc.
    Message was edited by:
    filestream
    Message was edited by:
    filestream

  • JVM + Linux kernel, can it have faster program execution

    Hello, I am a Garo Garabedyan from Sofia, Bulgaria. I study IT and I am a fan of Java programming language. I heard that Java is going Open Source, I want to say you that in my opinion this is a very good move.
    I am writing to you about one thought on Java and other languages like it (C# in example) which can become more faster in execution. Let me explain you how.
    In linux (i prefer this OS) the kernel capsulates running programs in Virtual Memory jails so they can't address memory space other that they own. This is to make the OSes more secure and run any kind of programs.
    But now we got this type of languages where client-programmer can't access the memory directly, instead of it he uses references. I want to encourage you to think in this way. Why we need virtual memory capsulization when we can't access others program memory? So think further. I believe that Java is going to be more popular from now, just imagine that we can run a lot of Java programs on one virtual machine. So in this way we are more faster. Transfering data between programs is going to be only cutting references.
    In order to implement this i think that there are few things to be done.
    As a fan of Open Source, i want to picture this in linux.
    I will try to go from kernel to jvm to recognize the changes:
    1)In kernel there should be a not capsulating logic specially for Java programs. The idea is to have every program separated in kernel, so other programs to be able to address them.
    2)The JVM should use one garbage collector for the all running programs
    3)JVM have to have in itself implementation of communication protocol(s) between programs in one operating system. In order to make java programs connect to other ones with the same interface (it makes me fool to describe this deeper, because i don't know enough in this topic)
    The main idea that i want to picture is the ability to make executing programs faster.
    I want to populize this way of thinking and will try to connect with Open Source community in order to make this done not only for Java programs but for OpenSource programs with checking the memory access before compilation (with reference checking tools) and run the program not in a virtual memory. Of course this is as hard as i can't imagine is it possible to be done, but i will try to publish this idea.
    Thank you for your attention
    Garo Garabedyan
    http://garabedyan.blogspot.com/search/label/OpenSource

    Many criticisms of Xen can be found with a simple Google search. The biggest one seems to be the need to modify guest OS code to make it run properly with Xen, but that is going away as Xen adds support for AMD-V and Intel VT technologies. KVM is coming on strong in the virtualization market now and seems to be the accepted choice.
    That said, I'm not sure how you would setup the machine to properly host VMs with KVM.
    Also, you may want to Google kexec to research that restarting the kernel without rebooting idea.

  • Invoking gdb through a Java program as subprocess

    Hi,
    I try to invoke the gdb through a java program using Runtime.exec(...)
    as a Process, I also try to get the output of gdb using InputStream object, Is there any way to provide the options to gdb when it is started as Process & also tracing it's output.
    please help Me.

    Have a read of
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-
    traps.htmlwhat ? I'm not sure what you are referring to with your 'what?' BUT that reference should be read by anyone using Runtime.exec().
    >
    the unix command such as
    tail xxxxxxxxxxxxxxxxxx
    and write it to a shell script,and invoke it by
    java,any problems?I don't agree with this. There is no need for a shell script. This would just add to the complexity without adding any extra functionality.
    >
    but sabre150 has give a good solutionThank you.

  • A simple Java program to be compiled with ojc and executed with java.exe

    Hi ,
    This thread is relevant to Oracle Java Compiler (file ojc) and jave.exe file.
    I have written a simple java program which consists of two simple simple classes and using the JDev's 10.1.3.2 ojc and java files , i'm trying to execute it after the successful compilation....
    The problem is that trying to run it... the error :
    Exception in thread "main" java.lang.NoClassDefFoundError: EmployeeTest
    appears.
    How can i solve this problem...????
    The program is as follows:
    import java.util.*;
    import corejava.*;
    public class EmployeeTest
    {  public static void main(String[] args)
       {  Employee[] staff = new Employee[3];
          staff[0] = new Employee("Harry Hacker", 35000,
             new Day(1989,10,1));
          staff[1] = new Employee("Carl Cracker", 75000,
             new Day(1987,12,15));
          staff[2] = new Employee("Tony Tester", 38000,
             new Day(1990,3,15));
          int i;
          for (i = 0; i < 3; i++) staff.raiseSalary(5);
    for (i = 0; i < 3; i++) staff[i].print();
    class Employee
    {  public Employee(String n, double s, Day d)
    {  name = n;
    salary = s;
    hireDay = d;
    public void print()
    {  System.out.println(name + "...." + salary + "...."
    + hireYear());
    public void raiseSalary(double byPercent)
    {  salary *= 1 + byPercent / 100;
    public int hireYear()
    {  return hireDay.getYear();
    private String name;
    private double salary;
    private Day hireDay;
    For compilation... i use :
    D:\ORACLE_UNZIPPED\JDeveloper_10.1.3.2\jdev\bin\ojc -classpath D:\E-Book\Java\Sun_Java_Book_I\Corejava EmployeeTest.java
    For execution , i issue the command:
    D:\ORACLE_UNZIPPED\JDeveloper_10.1.3.2\jdk\bin\java EmployeeTest
    NOTE:I tried to use the jdk of Oracle database v.2 but the error :
    Unable to initialize JVM appeared....
    Thanks , a lot
    Simon

    Hi,
    Thanks god....
    I found a solution without using Jdev.....
    C:\oracle_files\Java\Examples>SET CLASSPATH=.;D:\E-Book\Java\Sun_Java_Book_I\Corejava
    C:\oracle_files\Java\Examples>D:\ORACLE_UNZIPPED\JDeveloper_10.1.3.2\jdk\bin\javac EmployeeTest.java
    C:\oracle_files\Java\Examples>D:\ORACLE_UNZIPPED\JDeveloper_10.1.3.2\jdk\bin\java EmployeeTest
    What does Ant has to do with this?Sorry, under the Ant tree a classpath label is found....I'm very new to Java and JDev...
    You need to include the jar file that has the Day method in it inside project properties->libraries.I have not .jar file.. just some .java files under the corejava directory.... By the way , I have inserted the corejava directory to the project pressing the button Add Jar/Directory.... , but the problem insists..
    Thanks , a lot
    Simon

  • How to know if the java program is already running?

    I have a simple java program, and I need some way to know if this program is already running. I need it because when I execute this program and during this execution I execute it again, two java programs are running in the Operating System. Is there any java method that tells if the current program is already running?

    Hey, stevejluke and nicklap, do you know about Threads? I NEED SOME HELP, URGENTLY!!! I�ve posted the same problem two times in this forum, but nobody gave me the solution. It seems to be very simple, and I�m very angry because I am wasting a long time because this ridiculous problem. Read the text below please. If you know some suggestion or tip, tell me!
    Sorry for posting this topic again. But I need some suggestion urgently. I put the last post below.
    ==============================
    I�ve been trying to test my application in Eclipse, and I am using threads. But when I debug it, sometimes the behavior is not what I am expecting. Sometimes when I stop at some breakpoint for a long time, the debug stops to execute. Curiously the application runs perfectly in run mode.
    Has anyone had this problem?
    Thanks.
    ==============================
    ==============================
    (m.winter)
    Debugging threads works perfectly in eclipse. However be aware: If you just set a breakpoint by doubleclicking left to the source line, then its policy ist to stop the trhread, not the VM. That means, once you reach the breakpoint, only the thread reaching that line is stopped. All other threads continue running. If a second thread later also hits that line, it is also stopped. This makes it sometimes difficult to find out, where you are, as two or more threads may be suspended. You can see the status of the threads and switch between them in the treah view, typically in the upper half of the screen.
    You can change the behaviour of a breakpoint to "suspend VM" by left-clicking on the breakpoint and choosing breakpoint properties.
    I assume in your case, that other threads are continuing to run. They may e.g. produce data, which is supposed to be worked on by the suspended thread. If you stay a long time at the breakpoint, finally you might run out of memory or something else happens, which does not occur in run mode.
    ==============================
    ==============================
    (Peter-Lawrey)
    If you have anything in your code which is time depend it can run fine, except when you debug it.
    e.g. if one thread times out because you have stopped another thread.
    ==============================
    ==============================
    Thanx, but I didn�t understand yet.
    Sorry if I commit any English language error, I�m learning English.
    Please try to debug the code below:
    public class Main {
        public static void main(String[] args) {
            Shared objShared = new Shared();
            Thread thread1 = new Thread(new Thread1(objShared));
            Thread thread2 = new Thread(new Thread2(objShared));
            thread1.start(); //put breakpoint here
            thread2.start();
    class Thread1 implements Runnable {
        private Shared objShared;
        Thread1(Shared shared) {
            objShared = shared;
        public void run() {
            try {
                objShared.doSomething1();          
            } catch(InterruptedException e) {
                e.printStackTrace();
    class Thread2 implements Runnable {
        private Shared objShared;
        Thread2(Shared shared) {
            objShared = shared;
        public void run() {
            try {
                objShared.doSomething2();          
            } catch(InterruptedException e) {
                e.printStackTrace();
    class Shared {
        private boolean x = false;
        synchronized void doSomething1()
            throws InterruptedException {
            while (x) //put breakpoint here
                wait();
            System.out.println("Doing something 1");
            x = true;
            notifyAll();
        synchronized void doSomething2()
            throws InterruptedException {
            while (!x)
                wait();
            System.out.println("Doing something 2");
            x = false;
            notifyAll();
    }"If you stay a long time at the breakpoint, finally you might run out of memory or something else happens" - I don�t wait a very long time. Just few seconds in the "while" breakpoint is enough to debug stops the execution.
    "You can change the behaviour of a breakpoint to "suspend VM" - I did it, but in properties I didn�t find any thing to configure in order to debug perfectly.
    In debug mode, when I press F6 button rapidly, this program is executed perfectly. The problem occurs only if the debug is stopped for few seconds in breakpoint. Try it, I�m really interested in the cause of this behaviour.
    Thanks a lot!
    ==============================
    I don�t know why does this behaviour occur! If anyone has the solution for my problem, please tell me!
    **************************************************************************************************************************

  • Creating a file from a Java Program

    Hi all,
    if I want to store a byte array to a file somewhere in the middle of my program... is it possible to create the file inside my Java program, i.e. the file will be created during the execution of my program, and then write this byte array into it? The name of the file to be created is predefined by me, and not thru user input.
    If so, does anyone have a sample source code to show me? or redirect me to somewhere ?
    Thanks in advance!
    Joe

    You can take a look at the File, FileOutputStream, FileInputStream classes. A simple one will be like:
    byte[] ar = {12,13,14};
    File file = new File("wee.dat");
    if (!file.exists())
    try
    FileOutputStream fos = new FileOutputStream(file);
    fos.write(ar);
    }catch (IOException io){}
    else
    ...

Maybe you are looking for

  • Mail app has stopped working after 10.9.4 update on July 4, 2014

    Mail is totally dead.  It does not connect to the internet.  Each of my email accounts has the exclamation triangle next to them.  No new peripherals or devices or USB connections were added after the update.  The system worked before the update, and

  • Hibernate OR EclipseLink...Which is best with Weblogic and Oracle DB?

    Hi All, In my company, we are using Oracle DB and Weblogic application server. So in the process to upgrade or switch to new ORM, we shortlisted two options - Hibernate and EclipseLink. I gathered following summary regarding both ORMs - Hibernate: 1.

  • Can't Connect 4620L to Macbook Air NYC

    This is my second sim and device, desperately looking for help to solve my connection issues with the 4620L and my macbook air. I switched from AT&T to get verizon apple products and they are just not working well at all.... can someone send me the o

  • Thinking of BT Vision - Bit of help please

    Just joined BT for broadband, due to go live on Friday. Have also been offered Vision however my Sky contract isn't up until 22 May. However, if I can get a good deal I don't mind overlaping the two for a month. I have been doing a bit of research in

  • Sun Enterprise Server 8 - Web application error

    If you can help, I can be satisfied. When I try to deploy a .war file I always get this error in the following. <-- A "com.sun.enterprise.tools.guiframework.exception.FrameworkException" was caught. The message from the exception: "java.lang.reflect.