Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-17-2010, 02:57 AM   #1
LQ Newbie
Registered: Feb 2009
Posts: 5

Rep: Reputation: 0
Unhappy cannot compile java program in SUSE 11.1 using javac

I'm very new to java programming..i just grabed a book and wrote a program and tried to compile it using 'javac' and everytime i'm getting this error:

/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../lib64/crt1.o: In function `_start':
/usr/src/packages/BUILD/glibc-2.9/csu/../sysdeps/x86_64/elf/start.S:109: undefined reference to `main'
collect2: ld returned 1 exit status

my program is very simple

class Example
public static void main(String args[])
System.out.println("This is My First JAVA Program");

plz help me..what do i need to install?
I cheked internet and found my java version in 1.6.0_0
plz help me
thanks in advance
Old 06-17-2010, 02:59 AM   #2
Registered: Jun 2010
Location: INDIA
Distribution: All Linux & Unix
Posts: 86

Rep: Reputation: 19
install jdk
Old 06-17-2010, 03:11 AM   #3
LQ Newbie
Registered: Feb 2009
Posts: 5

Original Poster
Rep: Reputation: 0
thanks..but can you plz tell me how to install jdk and from where and which version(if there is any)??
Old 06-17-2010, 03:50 AM   #4
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2018 CentOS6.10 CentOS7.5 + 50+ other Linux OS, for test only.
Posts: 17,125

Rep: Reputation: 3491Reputation: 3491Reputation: 3491Reputation: 3491Reputation: 3491Reputation: 3491Reputation: 3491Reputation: 3491Reputation: 3491Reputation: 3491Reputation: 3491
You should be able to find java-1_6_0-sun in the package manager
( Yast2 ) or with the command # zypper se java.

Then choose the jdk , 64 Bits version for install, and it will be updated.

Also please check this ( also as root (su)) :
update-alternatives --config java
...... And then choose the sun java, if not already set.

Version check = the command : java -version
.. to be sure, you are not using the "openjdk" or the gcc-java.
>> The genuine sun java jdk is the most reliable.

Last edited by knudfl; 06-17-2010 at 06:50 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
configure: error: Can't find "javac" in your PATH, when install/compile a program... JungMin Programming 5 12-07-2005 06:04 PM
use gcc or javac for java compile? jordanGSU Programming 22 10-15-2004 10:12 AM
Help php compile javac or java system environment variable antony_csf Programming 1 06-16-2004 02:12 PM
Help php exec, system function for compile javac or java antony_csf Programming 0 06-15-2004 02:45 AM
Can't compile Java Swing Applet with javac chansky Programming 4 09-23-2002 05:50 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:04 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration