LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-31-2007, 01:46 AM   #1
maranganesan
LQ Newbie
 
Registered: Dec 2007
Posts: 3

Rep: Reputation: 0
cant compile java files in fedora 8.. java/


Hello linux freaks and friends..

I am a newbie..
I am using Fedora core 8..
I have installed Fedora 8 with all the packages(full complete installation)
Now the problem is that i cant compile java files in fedora core 8..

my file name is example.java

when i type
[maran@fedora8 works]$ javac example.java
/*the following error appears*/
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object

what should i do?

i searched many forums.. i cant find.. i am new to the linux world as well this forum,,
if this question is already discussed in this pl give me the link..
somebody pl help me answering the question here itself..
i am ready to post here anything you ask like PATH etc..

[maran@fedora8 works]$ which java
/usr/bin/java

[maran@fedora8 works]$ java -version
java version "1.5.0"
gij (GNU libgcj) version 4.1.2 20070925 (Red Hat 4.1.2-33)

[maran@fedora8 works]$ type -a javac
javac is /usr/bin/javac

[maran@fedora8 works]$ type -a java
java is /usr/bin/java

[maran@fedora8 works]$ echo $PATH
/usr/lib/qt-3.3/bin:/usr/kerberos/bin:
/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:
/INSTALL/Ns2/ns-allinone-2.31/bin:
/INSTALL/Ns2/ns-allinone-2.31/tcl8.4.14/unix:
/INSTALL/Ns2/ns-allinone-2.31/tk8.4.14/unix:
/home/maran/bin:/INSTALL/Ns2/ns-allinone-2.31/bin:
/INSTALL/Ns2/ns-allinone-2.31/tcl8.4.14/unix:
/INSTALL/Ns2/ns-allinone-2.31/tk8.4.14/unix

/* i have NS2 thats the reason for these commands*/

if there is anything missing pl tell me what to type?

any help will ve greatly appreciated....

pl help meeeeeee its required for my final year project..

Regards..
Maran G
 
Old 12-31-2007, 02:19 AM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

There are several problems here. One of them is that your Gnu Java ("gjc") compiler doesn't appear to be configured correctly.

A more fundamental problem, however, is that Gjc happens to be the default (instead of the very different - and, IMHO, better) Sun Java compiler.

I would strongly encourage you to:
a) download the Sun JDK from Sun's web page
b) *de-install* Gjc (to avoid potential conflicts between Sun Java and GJC)
c) Install Sun Java (and only Sun Java - at least until your development environment is stable)

You can download the Sun JDK here:
http://java.sun.com

Sun's web site has extensive documentation for installing and using Java under Linux (it's really quite straightforward).

'Hope that helps .. PSM
 
Old 12-31-2007, 03:21 AM   #3
maranganesan
LQ Newbie
 
Registered: Dec 2007
Posts: 3

Original Poster
Rep: Reputation: 0
hello paulsm4.,
Thanks a lot for your reply...
can you also tell me how to un install the existing version and install the new one?so as to avoid the conflicts as you say...
can you post the commands please?
do i have to install through net i mean online or i can download and install seperately..give me some instructions...
once again thanks for your reply...

Regards
Maran G
 
Old 12-31-2007, 03:26 AM   #4
maranganesan
LQ Newbie
 
Registered: Dec 2007
Posts: 3

Original Poster
Rep: Reputation: 0
could you please also give the correct link to download.. there are several packages in the site..
to remind you i am very new to java and linux...pl help..
 
Old 12-31-2007, 12:21 PM   #5
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
maranganesan -

1. You should be able to find answers to most of your questions on Sun's web site, or you can Google for the keywords "Linux Java SDK tutorial". Here's a great example:

http://www.yolinux.com/TUTORIALS/LinuxTutorialJava.html

2. As far as "which download" - you want any download for "Linux" with "SDK" ("Software Development Kit"). I'd recommend the "Netbeans + SDK 1.6.x" combo.

3. Per the above link, the command for uninstalling GJC would be:
Quote:
rpm -e java-1.4.2-gcj-compat-1.4.2.0-27jpp java-1.4.2-gcj-compat-devel-1.4.2.0-27jpp.noarch
<= You will undoubtedly have a different version of "GJC" to uninstall
You can find the .RPM version with this command:
Quote:
rpm -qa|grep -i gcj
4. Yes, you can download to your PC, then install directly from hard disk separately. Per the above link (for example), the install command would be:
Quote:
a) Start a command prompt

b) "cd" to your download directory (e.g. "cd /tmp")

c) Set "execute" permissions on your download file:
chmod +x j2sdk-1_4_0_03-linux-i586-rpm.bin
<= You will obviously have a different, "j2sdk-1_6_x_x..." version!!!

d) Extract the .RPM (Linux equivalent of "setup"):
./j2sdk-1_4_0_03-linux-i586-rpm.bin

e) Run the .RPM:
rpm -ivh j2sdk-1_4_0_03-fcs-linux-i586.rpm
There's plenty of on-line help, and Google is your Friend.

'Hope that helps .. PSM

Last edited by paulsm4; 12-31-2007 at 12:25 PM.
 
  


Reply


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
Java Programming: Java Runtime Environment not found when trying to compile murbz Linux - Software 2 03-26-2009 03:04 AM
Firefox refuses to load Java jnlp files - plugin and java ok Melsync Linux - Software 1 06-25-2006 04:09 PM
Fedora Core 1 Associating .jar files with java -jar command pymehta Fedora 0 01-13-2005 05:26 AM
Compile Java - .class, .java, .jar ? woranl Programming 2 11-09-2004 10:12 PM
Java: Compile Large number of source files ? mikeshn Programming 7 10-07-2003 11:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:18 AM.

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