Results 1 to 7 of 7

Thread: cannot compile java program

  1. #1
    Join Date
    Jan 2012
    Beans
    35

    Question cannot compile java program

    I hate to ask questions but I am at lost now. i have browse the forum for 1 hour without success.
    I am planning to use ubuntu to write java programs and i have installed visualVM from software centre. But when i tired to test the java program i have written it gives the following error.
    ************************************************** ****************
    bariamtak@bariamtak-pc:~$ cd Desktop
    bariamtak@bariamtak-pc:~/Desktop$ javac dyninit.java
    dyninit.java:7: package system does not exist
    system.out.println("hypotenuse is " +c);
    ^
    1 error
    bariamtak@bariamtak-pc:~/Desktop$
    ************************************************** *****************
    I am in ubuntu 11.10. Can you please tell me i need to do.
    thank you.

  2. #2
    Join Date
    Feb 2008
    Beans
    251
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: cannot compile java program

    Hi, welcome to the forums

    It looks like you have an error in your java not with your Ubuntu system:

    http://java-error-messages.blogspot....not-exist.html

    Maybe using an IDE (eg. Eclipse) with a built in compiler might help you while you're getting started? They can help you identify where the errors are in your code

  3. #3
    Join Date
    Nov 2009
    Beans
    3,336

    Re: cannot compile java program

    Try this as this appears to be one of the packages not installed

    Type these in a terminal

    sudo apt-get install javacc

    Have you tried eclipse too

    sudo apt-get install eclipse

  4. #4
    Join Date
    Jan 2012
    Beans
    35

    Re: cannot compile java program

    thank you for repying. I'll try eclipse and get back to you.

  5. #5
    Join Date
    May 2006
    Beans
    115

    Re: cannot compile java program

    Shouldn't it be System, with a capital S? Or is that just a typo in the forum post?

  6. #6
    Join Date
    Jan 2012
    Beans
    35

    Re: cannot compile java program

    Thank You benson444 .
    what a silly mistake ! I am new in linux so i was quick in putting the blame on it. Sorry ma bad !

  7. #7
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,703

    Re: cannot compile java program

    Yup. Follow the link that greenpeace gave in post #2.

    Moved to Programming Talk.

Bookmarks

Posting Permissions

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