Forum     

Go Back   Digit Technology Discussion Forum > Software > Open Source
Register FAQ Calendar Mark Forums Read

Open Source A place where you can talk to like-minded people about the fastest growing software movement today! Discuss anything and everything about Open Source software and Operating Systems.


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 21-02-2006, 01:34 AM   #1 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Cannot compile java program in Ubuntu.


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
Quote:
class Temp
{
static int x=10;
public static void main(String agrs[])
{
Temp t = new Temp();
t.show();
Temp t1 = new Temp();
t1.x=20;
t1.show();
}
}
And here the error message I get
Quote:
Temp.java: In class 'Temp':
Temp.java: In method 'Temp.main(java.lang.String[])':
Temp.java:7: error: Can't find method ‘show()’ in type ‘Temp’.
t.show();
^
Temp.java:10: error: Can't find method ‘show()’ in type ‘Temp’.
t1.show();
^
2 errors
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.
mehulved is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 21-02-2006, 02:20 AM   #2 (permalink)
Wise Old Owl
 
desertwind's Avatar
 
Join Date: Nov 2004
Location: Hyderabad
Posts: 1,096
Default

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/
__________________
Sometime you'll think you understand everything

...Then you'll regain consciousness
desertwind is offline  
Old 21-02-2006, 02:23 AM   #3 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default

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.
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 28-02-2006, 01:10 PM   #4 (permalink)
Broken In
 
tech_cheetah's Avatar
 
Join Date: Jul 2005
Location: Gurgaon
Posts: 150
Default

ya the problem is that u have not defined show() in ur class.
__________________
Be honest . By that way u can be sure that the world is short of atleast one rascal.
tech_cheetah is offline  
Old 28-02-2006, 09:34 PM   #5 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default

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.
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 28-02-2006, 10:32 PM   #6 (permalink)
Alpha Geek
 
Satissh S's Avatar
 
Join Date: Mar 2005
Location: Chennai , India
Posts: 693
Default

@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.
Satissh S is offline  
Old 01-03-2006, 02:17 PM   #7 (permalink)
FooBar Guy
 
GNUrag's Avatar
 
Join Date: Jun 2004
Location: GNUmbai
Posts: 1,245
Default

Quote:
Originally Posted by Satissh S
I use Blackdown-Java and OSS implementation of Java. Besides this there are sun-java and ibm-java in gentoo - portages.
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.
__________________
- --
http://web.gnuer.org
GNUrag is offline  
Old 01-03-2006, 04:26 PM   #8 (permalink)
Alpha Geek
 
Satissh S's Avatar
 
Join Date: Mar 2005
Location: Chennai , India
Posts: 693
Default

But gnurag! How come?? i was able to install it using gentoo-portage and AFAIK portage has only FOSS software collection? :roll:
Satissh S is offline  
Old 01-03-2006, 05:30 PM   #9 (permalink)
FooBar Guy
 
GNUrag's Avatar
 
Join Date: Jun 2004
Location: GNUmbai
Posts: 1,245
Default

Please read this: http://en.wikipedia.org/wiki/Blackdown_Java


Quote:
Blackdown Java is a port of Sun's Java virtual machine to Linux by a group of volunteers. It predates Sun's official Linux port. It still supports platforms the official version does not, including SPARC and PowerPC. Currently, Blackdown Java supports up to version 1.4.2 of the Java run-time libraries. Despite widespread confusion, Blackdown is neither Free Software nor Open Source.
Also: http://en.wikipedia.org/wiki/Java_virtual_machine
GNUrag is offline  
Old 01-03-2006, 07:56 PM   #10 (permalink)
left this forum longback
 
praka123's Avatar
 
Join Date: Sep 2005
Location: -
Posts: 7,536
Default

I use java-package to make .deb of sun-j2re and install it simple. 8)
__________________
left this forum long back.Admin Can Delete this Account and posts Permanantly.Thank You
Get GNU/Linux - http://getgnulinux.org
praka123 is offline  
Old 02-03-2006, 01:04 PM   #11 (permalink)
FooBar Guy
 
GNUrag's Avatar
 
Join Date: Jun 2004
Location: GNUmbai
Posts: 1,245
Default

Quote:
Originally Posted by prakash kerala
I use java-package to make .deb of sun-j2re and install it simple. 8)
Wouldnt it be fun if GNU Classpath could mature and we wouldnt have to use Sun's JRE then.
__________________
- --
http://web.gnuer.org
GNUrag is offline  
Old 05-03-2006, 07:18 AM   #12 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default

@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?
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 05-03-2006, 11:24 AM   #13 (permalink)
Alpha Geek
 
Satissh S's Avatar
 
Join Date: Mar 2005
Location: Chennai , India
Posts: 693
Default

@mehul: What version you have? Just installed netbeans 5 and it seriously rocks!!
__________________
Call it Emacs,
Love it or Leave it.
Satissh S is offline  
Old 05-03-2006, 06:42 PM   #14 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default

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?
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 05-03-2006, 11:56 PM   #15 (permalink)
Wise Old Owl
 
desertwind's Avatar
 
Join Date: Nov 2004
Location: Hyderabad
Posts: 1,096
Default

Netbeans rocks for sure, but you need atleast 512 MB RAM for a fine smooth running.
__________________
Sometime you'll think you understand everything

...Then you'll regain consciousness
desertwind is offline  
Old 06-03-2006, 12:44 AM   #16 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default

Thanks Riyaz. Hopefully, I get more RAM this week or else I should be on a lookout for other IDE.
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 08-03-2006, 12:00 AM   #17 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default

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.
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 08-03-2006, 12:09 AM   #18 (permalink)
Alpha Geek
 
Satissh S's Avatar
 
Join Date: Mar 2005
Location: Chennai , India
Posts: 693
Default

@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!!
__________________
Call it Emacs,
Love it or Leave it.
Satissh S is offline  
Old 08-03-2006, 12:15 AM   #19 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default

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.
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 08-03-2006, 01:19 AM   #20 (permalink)
Alpha Geek
 
Satissh S's Avatar
 
Join Date: Mar 2005
Location: Chennai , India
Posts: 693
Default

Hey! I suggest to do a gentoo stage 1 install.. REally it's the better choice. You'll notice the differnce. Here is a document i found very very useful. You can Follow it as such. Good Luck!!
http://gentoo-wiki.com/HOWTO_Newbie_...nstall#TESTING
__________________
Call it Emacs,
Love it or Leave it.
Satissh S is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by Sujeet
- by icebags
- by clinton
- by topgear

Advertisement




All times are GMT +5.5. The time now is 10:19 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2