Compiling Java Code

Hi,
After messing up with grub, I reformatted my hdd and installed opensuse 11.4 (gnome+kde) from the dvd and also included the java sdk while installing, now the problem is that whenever i compile a java program,
I get this error


/usr/src/packages/BUILD/glibc-2.11.3/csu/../sysdeps/x86_64/elf/start.S:109: undefined reference to `main'

please help.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Are you explicitly using the javac from the JDK or are you using the one
in your PATH (by not specifying one) and using the one from GCC instead
that maybe doesn’t work the same way?

Good luck.


Want to yell at me in person?
Come to BrainShare 2011 in October: http://tinyurl.com/brainshare2011
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOQYAGAAoJEF+XTK08PnB5zccP/1Kje6/gNyiE8byLuGfwhCrY
z0sKMRtK8Ffhhz6gNAF5CLPrl0vVKw9wTbNjeN4xn/Q36eYNDFOym5QKRxA1A/Y+
qRpdYLIkgtXmAmi4fDN2ZqtSQdIDF0Cml4FgAJDE8RXU5fx746iW3pAzJ5n6/o7M
8RogWSgruIQeYXroOzTwoKsH9AbNO7Gp4GnkaJUALPlcXuUw1IigSEAIWM3Yl1OR
/Dd/2TtTrQmOmByv89XrYwSgp7OodorO8X+SD58V8AgffNYxPrQIWNOzpBoP7xHF
9QOsciEgDSa7PC/OC8Sasm4MtE9IiphnuIXdF6lsWVSv9GmS43r7Wl7rU//nOiv1
OQxb/aPnNM6Tjp/pHGgVVhq+WmrcHBr+7T7H0V989D2PeU9of69wivDuKclWsN8T
fo3FCzrnxbOz/p29/SFQXC9QjETvFuaoEBEHehaDYWv1dtpcTuVdCeXaxpNxqezx
zCSI4UPmQyLup0V5LxC4vMR79c9wHn/moXsu6Oi7BACX5IFf7mXkNNIHeqjDQnM2
AbrkbZEswVfL2IVjfBwOc6dDTxOnI3i3ayBATgN8URcdhNCxb7raiSIe6JEbAlBr
8aTE71FrVCUr8OhW22JUM9jsvPDzdsqGbcnCOr2urAr7I100kWzJ6O+q7qseSZSU
xLpJFC7wa3jq/kOTdJ9M
=Fm+O
-----END PGP SIGNATURE-----

yeah, i used gcc compiler for java. But now, i downloaded eclipse. any ways to clear the above error?
shud i need to have the jdk package for java to run smoothly?

Hi,

Eclipse is a Java application, I am not sure if it is a stand alone run time Java app, but regardless of that it uses the environment Java compiler.
So please install the Java JDK and every thing should be ok.
Just go to Yast and search for Java, among the options there should be the Sun Java JDK.

Regards.