Cannot compile java program in Ubuntu.

Discussion in 'Open Source' started by mehulved, Feb 21, 2006.

Thread Status:
Not open for further replies.
  1. mehulved

    mehulved 18 Till I Die............

    Joined:
    Jul 15, 2004
    Messages:
    5,790
    Likes Received:
    44
    Trophy Points:
    0
    Location:
    India, Mumbai, Marine Lines
    I have started learning java now. So, I decided to practise a bit at home. For that I downloaded and installed JDK 1.5 on my system.
    I am still on basics of java as I've just began. I compiled and ran one-two program without problems. But, when I come to the program below, I get an error code.
    Here the program
    And here the error message I get
    This program ran fine in my classes on windows server 2000 and JDK1.3.

    Also, can anyone suggest me a good, free GUI application for java pragramming eg. Jcreator, which I got but it uses too much memory.
     
  2. desertwind

    desertwind New Member

    Joined:
    Nov 2, 2004
    Messages:
    1,096
    Likes Received:
    10
    Trophy Points:
    0
    Location:
    Hyderabad
    I'm not a java programmer. Well do you define the method show() in class Temp ? The error seems to be the method missing.

    The best IDE for Java for linux is NetBeans IDE. It's fully written on Java, and have many features. But a little heavy though.
    http://www.netbeans.org/
     
  3. OP
    OP
    mehulved

    mehulved 18 Till I Die............

    Joined:
    Jul 15, 2004
    Messages:
    5,790
    Likes Received:
    44
    Trophy Points:
    0
    Location:
    India, Mumbai, Marine Lines
    I will check the program again on thursday at my classes. I guess I am going wrong somewhere. Whatever I've given in the quotes is the full program. And actually I guess you're right, I haven't defined show.
    And will have a look at netbeans though something less RAM intensive will work gr8 for me as I got only 256 mb RAM.
     
  4. tech_cheetah

    tech_cheetah New Member

    Joined:
    Jul 11, 2005
    Messages:
    150
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Gurgaon
    ya the problem is that u have not defined show() in ur class.
     
  5. OP
    OP
    mehulved

    mehulved 18 Till I Die............

    Joined:
    Jul 15, 2004
    Messages:
    5,790
    Likes Received:
    44
    Trophy Points:
    0
    Location:
    India, Mumbai, Marine Lines
    You'll are right. The program wasn't printed properly in the book. I checked it out and the show method is missing. I was silly enough to not realise it.
    Thanks everyone foryour inputs.
     
  6. Satissh S

    Satissh S New Member

    Joined:
    Mar 23, 2005
    Messages:
    692
    Likes Received:
    2
    Trophy Points:
    0
    Location:
    Chennai , India
    @mehul: Netbeans seriously rocks!! It isn't a memory hogg as eclipse but i good in its own right and i like it too. Try using netbeans to edit your java progs. Which jre do you use? I use Blackdown-Java and OSS implementation of Java. Besides this there are sun-java and ibm-java in gentoo - portages.
     
  7. GNUrag

    GNUrag FooBar Guy

    Joined:
    Jun 22, 2004
    Messages:
    1,246
    Likes Received:
    5
    Trophy Points:
    0
    Location:
    Interwebs
    Blackdown JVM is not an OSS software. It is a proprietary implementation of Sun JVM and cannot be redistributed freely.

    To be able to run Java programs on a free operating system you may been to get hold of GNU Gcj and GNU Classpath packages

    GNU Classpath currently has complete implementations of java.* packages and preliminary implementations of javax.swing.* packages.
     
  8. Satissh S

    Satissh S New Member

    Joined:
    Mar 23, 2005
    Messages:
    692
    Likes Received:
    2
    Trophy Points:
    0
    Location:
    Chennai , India
    But gnurag! How come?? i was able to install it using gentoo-portage and AFAIK portage has only FOSS software collection? :roll:
     
  9. GNUrag

    GNUrag FooBar Guy

    Joined:
    Jun 22, 2004
    Messages:
    1,246
    Likes Received:
    5
    Trophy Points:
    0
    Location:
    Interwebs
    Please read this: http://en.wikipedia.org/wiki/Blackdown_Java


    Also: http://en.wikipedia.org/wiki/Java_virtual_machine
     
  10. praka123

    praka123 left this forum longback

    Joined:
    Sep 7, 2005
    Messages:
    7,513
    Likes Received:
    24
    Trophy Points:
    0
    Location:
    -
    I use java-package to make .deb of sun-j2re and install it simple. 8)
     
  11. GNUrag

    GNUrag FooBar Guy

    Joined:
    Jun 22, 2004
    Messages:
    1,246
    Likes Received:
    5
    Trophy Points:
    0
    Location:
    Interwebs
    Wouldnt it be fun if GNU Classpath could mature and we wouldnt have to use Sun's JRE then.
     
  12. OP
    OP
    mehulved

    mehulved 18 Till I Die............

    Joined:
    Jul 15, 2004
    Messages:
    5,790
    Likes Received:
    44
    Trophy Points:
    0
    Location:
    India, Mumbai, Marine Lines
    @Satish I got netbeans installed but it slows down my computer to a crawl. I may be adding some RAM in my computer this week. If I do netbeans seems to be a good solution.
    @anurag I got gcj already installed.I need to get classpath now? Sorry if I am getting things wrong as I am still very new to java.
    If I use gcj and classpath will coding be different from using jdk on windows which is used in aptech to teach java?
     
  13. Satissh S

    Satissh S New Member

    Joined:
    Mar 23, 2005
    Messages:
    692
    Likes Received:
    2
    Trophy Points:
    0
    Location:
    Chennai , India
    @mehul: What version you have? Just installed netbeans 5 and it seriously rocks!!
     
  14. OP
    OP
    mehulved

    mehulved 18 Till I Die............

    Joined:
    Jul 15, 2004
    Messages:
    5,790
    Likes Received:
    44
    Trophy Points:
    0
    Location:
    India, Mumbai, Marine Lines
    I got netbeans 5 too. I had tried to use it with Ubuntu using fluxbox wm and other application running was opera9. That too made my system to start becoming too slow to work on. I only got 256mb of RAM now. If you think the RAM is good enough than what else do you think can be the problem?
     
  15. desertwind

    desertwind New Member

    Joined:
    Nov 2, 2004
    Messages:
    1,096
    Likes Received:
    10
    Trophy Points:
    0
    Location:
    Hyderabad
    Netbeans rocks for sure, but you need atleast 512 MB RAM for a fine smooth running.
     
  16. OP
    OP
    mehulved

    mehulved 18 Till I Die............

    Joined:
    Jul 15, 2004
    Messages:
    5,790
    Likes Received:
    44
    Trophy Points:
    0
    Location:
    India, Mumbai, Marine Lines
    Thanks Riyaz. Hopefully, I get more RAM this week or else I should be on a lookout for other IDE.
     
  17. OP
    OP
    mehulved

    mehulved 18 Till I Die............

    Joined:
    Jul 15, 2004
    Messages:
    5,790
    Likes Received:
    44
    Trophy Points:
    0
    Location:
    India, Mumbai, Marine Lines
    I just installed 512 MB more RAM and now my computer seems to be working like breeze even with netbeans runnning. I am running fluxbox wm, besides netbeans opera and FF are also running without straining the computer at all.
     
  18. Satissh S

    Satissh S New Member

    Joined:
    Mar 23, 2005
    Messages:
    692
    Likes Received:
    2
    Trophy Points:
    0
    Location:
    Chennai , India
    @mehul_ved:
    Nice!! Did you notice the difference while running fluxbox? It's extremely customisable too!
    But i use FVWM2 which is more so customisable and you can keep your favourite apps right at your finger tips. It uses the same amt of memory.
    Imagine running kde, with these apps open!!
     
  19. OP
    OP
    mehulved

    mehulved 18 Till I Die............

    Joined:
    Jul 15, 2004
    Messages:
    5,790
    Likes Received:
    44
    Trophy Points:
    0
    Location:
    India, Mumbai, Marine Lines
    Yeah it does make a lot of difference. Well I haven't customised Fluxbox as yet. I am off to installing gentoo now.
    Netbeans seems a bit complicated as of now but I will use it since it seems gr8 and many of you'll have recommended it. Thanks everyone for the replies. Will tryout gcj, classpath and netbeans.
     
  20. Satissh S

    Satissh S New Member

    Joined:
    Mar 23, 2005
    Messages:
    692
    Likes Received:
    2
    Trophy Points:
    0
    Location:
    Chennai , India
Thread Status:
Not open for further replies.

Share This Page