Results 1 to 9 of 9
  1. #1
    hooshdar3 is offline Member
    Join Date
    Jul 2014
    Posts
    28
    Rep Power
    0

    Default unable to javac my program

    Hi
    This is my program:
    Java Code:
    public class TestRuntime{
    	public static void main(String args[]) throws Exception
    	{
    		Process p = Runtime.getRuntime().exec("mpstat");
    	}
    }
    I get the following output when javac'ing it:
    $ javac TestRuntime.jave
    error: Class names, 'TestRuntime.jave', are only accepted if annotation processing is explicitly requested
    1 error
    What does the error say?

  2. #2
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,094
    Rep Power
    4

    Default Re: unable to javac my program

    Java sources should be in a file with the .java extension.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,365
    Rep Power
    6

    Default Re: unable to javac my program

    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  4. #4
    hooshdar3 is offline Member
    Join Date
    Jul 2014
    Posts
    28
    Rep Power
    0

    Default Re: unable to javac my program

    Quote Originally Posted by gimbal2 View Post
    similiar programs, different problems, right?

  5. #5
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,365
    Rep Power
    6

    Default Re: unable to javac my program

    What's different about it? Both 'programs' do exactly the same. You're only abusing the fact that you use two different ways to do the same thing to sprout two different threads.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  6. #6
    hooshdar3 is offline Member
    Join Date
    Jul 2014
    Posts
    28
    Rep Power
    0

    Default Re: unable to javac my program

    Quote Originally Posted by gimbal2 View Post
    What's different about it? Both 'programs' do exactly the same. You're only abusing the fact that you use two different ways to do the same thing to sprout two different threads.
    No, this thread is about a strange error while executing a program, and that thread is about an exception-an internal error-Two different problems

  7. #7
    hooshdar3 is offline Member
    Join Date
    Jul 2014
    Posts
    28
    Rep Power
    0

    Default Re: unable to javac my program

    Quote Originally Posted by gimbal2 View Post
    What's different about it? Both 'programs' do exactly the same. You're only abusing the fact that you use two different ways to do the same thing to sprout two different threads.
    No, this thread is about a strange error while executing a program, and that thread is about an exception-an internal error-Two different problems

  8. #8
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,365
    Rep Power
    6

    Default Re: unable to javac my program

    Okay, fair enough. Not a dupe problem description, just dupe code for the exact same program you are trying to copy/paste together. Did you see Surfman's answer?
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  9. #9
    hooshdar3 is offline Member
    Join Date
    Jul 2014
    Posts
    28
    Rep Power
    0

    Default Re: unable to javac my program

    Quote Originally Posted by gimbal2 View Post
    Okay, fair enough. Not a dupe problem description, just dupe code for the exact same program you are trying to copy/paste together. Did you see Surfman's answer?
    Yesw, +my insane mistake!The problem is [solved]

Similar Threads

  1. Replies: 10
    Last Post: 03-09-2012, 01:28 PM
  2. Netbeans (demo) "Unable to find a javac compiler
    By pottzie in forum New To Java
    Replies: 0
    Last Post: 10-25-2011, 11:52 PM
  3. Replies: 3
    Last Post: 03-25-2011, 07:31 AM
  4. javac: invalid flag: Files\Java\jdk1.6.0_18;C:\Program
    By darrell22 in forum New To Java
    Replies: 5
    Last Post: 02-09-2010, 09:27 AM
  5. Replies: 8
    Last Post: 11-18-2008, 10:21 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
  •