Page 2 of 2 FirstFirst 12
Results 21 to 33 of 33
  1. #21
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    318
    Rep Power
    7

    Default

    I did it. Dear....

    any other idea.
    sanjeev,संजीव

  2. #22
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    318
    Rep Power
    7

    Default

    any other idea.
    sanjeev,संजीव

  3. #23
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  4. #24
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    318
    Rep Power
    7

    Default

    Quote Originally Posted by Eranga View Post
    Sanjeev, did you try with extending the exception class.
    No...But why..Nothing will happen by this
    sanjeev,संजीव

  5. #25
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Ah, just to check you have done something on that. There is no point to deal with it.

    Getting more interest this thread Sanjeev.

    I've tried two process as follows.

    Java Code:
    		try{
    			//Process proc = Runtime.getRuntime().exec("CheckException1.java");
    			Process proc = Runtime.getRuntime().exec("notepad.exe");
    
    		}catch(IOException err){  // or use catch(Throwable err)
    			System.out.println("ERROR....");
    		}
    On the first proc detect an error. I can't th specified file. Not only that file. I tried to open a text file. But not execute.

    But the second proc do the job correctly. Do you have any idea?

  6. #26
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    318
    Rep Power
    7

    Default

    Ya Eranga,

    Change into CheckException.java file, class name is ChceckException
    Java Code:
    public class [B]CheckException[/B] 
    {
    	public static void main(String[] args){
    		System.out.println("in CheckException...");
    	}
    }
    Try this and let me know the results. Compile with ChceckException1.java

    Java Code:
         Process proc = Runtime.getRuntime().exec("javac [B]CheckException1[/B].java");
    sanjeev,संजीव

  7. #27
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  8. #28
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    318
    Rep Power
    7

    Default

    Quote Originally Posted by Eranga View Post
    Yes, it works. I can catch the error.
    What it gives you.?

    Not giving me?????????
    sanjeev,संजीव

  9. #29
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Ah, sorry pal. Run the wrong file there.

    See this,

    Java Code:
    public class TestCheckException {
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
    		try{
    			Process proc = Runtime.getRuntime().exec("javac CheckException1.java");
                            System.out.println("TestCheckException - try block");
                    }
                    catch(IOException ss) {
                        System.out.println("File not found.");
                    }
        }
    
    }
    I didn't get an error. Print the "TestCheckException - try block" on the console :(

  10. #30
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by sanjeevtarar View Post


    What it gives you.?

    Not giving me?????????
    Sorry pal, make the wrong post there. Test the code on post previous post to this. :)

  11. #31
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    318
    Rep Power
    7

    Default

    Quote Originally Posted by Eranga View Post
    Ah, sorry pal. Run the wrong file there.

    See this,

    Java Code:
    public class TestCheckException {
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
    		try{
    			Process proc = Runtime.getRuntime().exec("javac CheckException1.java");
                            System.out.println("TestCheckException - try block");
                    }
                    catch(IOException ss) {
                        System.out.println("File not found.");
                    }
        }
    
    }
    I didn't get an error. Print the "TestCheckException - try block" on the console :(
    Dear i tried the same.....but my question is why it does not go to catch block
    sanjeev,संजीव

  12. #32
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Even me worried about that pal. How the process execution line skipped and println() execute?

    I'll working on it now to find the issue :(;(

  13. #33
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    318
    Rep Power
    7

    Default

    Quote Originally Posted by Eranga View Post
    Even me worried about that pal. How the process execution line skipped and println() execute?

    I'll working on it now to find the issue :(;(
    Hey Pal,

    Did you find some thing...
    sanjeev,संजीव

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 1
    Last Post: 03-08-2008, 06:41 PM
  2. doubt
    By shaju_inspira in forum Sun Java Wireless Toolkit
    Replies: 0
    Last Post: 01-18-2008, 08:38 AM
  3. doubt in jms
    By veena in forum Enterprise JavaBeans (EJB)
    Replies: 2
    Last Post: 01-05-2008, 01:42 PM
  4. Doubt on <bean> tag
    By sudhakarbe in forum Web Frameworks
    Replies: 0
    Last Post: 11-22-2007, 07:57 AM
  5. Doubt with classpath
    By fred in forum New To Java
    Replies: 1
    Last Post: 07-24-2007, 01:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •