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 12-01-2007, 10:40 PM   #1 (permalink)
In The Zone
 
Vivek788's Avatar
 
Join Date: Jul 2006
Location: Cochin
Posts: 339
Default java in linux

wat is the java compiler name for linux?wat commad can i use to compile and run java progs?
Vivek788 is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 12-01-2007, 10:55 PM   #2 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: java i linux

Which java have you installed and how?
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 12-01-2007, 11:30 PM   #3 (permalink)
Just another linux lover.
 
subratabera's Avatar
 
Join Date: Jun 2006
Location: Bangalore, KA
Posts: 559
Default Re: java i linux

AFAIK Java is same on any platform and uses the same command set to compile and run java programs...

Install JDK on your system and use it as you use it on Windows...
__________________
Today is a most unusual day, because we have never lived it before; we will never live it again; it is the only day we have.
(Registered Linux User #432737 - subratabera.blogspot.com)
subratabera is offline  
Old 13-01-2007, 09:39 AM   #4 (permalink)
In The Zone
 
Vivek788's Avatar
 
Join Date: Jul 2006
Location: Cochin
Posts: 339
Default Re: java i linux

i have to install?
I thought fc6 comes with java compiler...
Vivek788 is offline  
Old 13-01-2007, 01:12 PM   #5 (permalink)
Wise Old Owl
 
JGuru's Avatar
 
Join Date: Dec 2005
Location: Space-time continuum
Posts: 1,646
Default Re: java in linux

@Vivek788, You must install Sun's Java JDK 6.0. Get it from here
Select JDK 6.0 Click on the "Download" button.
For Full instructions of Installing Java in Linux Click here

After you have installed the Java JDK RPM. You need to follow these steps:

Open the Terminal Window & type:

$ su -
(Enter root password)

# gedit /etc/profile.d/java.sh
Add the following line at the end of the file

Code:
    export JAVA_HOME=/usr/java/jdk1.6.0
    export PATH=$JAVA_HOME/bin:$PATH
Save the file.

Now logout & login again to see the changes.

To compile a Java File:

$ Javac FileName.java


To Run a Java Program:

$ java FileName
__________________
* Imagination is more important than knowledge.
-Albert Einstein

Last edited by JGuru; 13-01-2007 at 06:02 PM. Reason: To make some changes
JGuru is offline  
Old 13-01-2007, 06:16 PM   #6 (permalink)
The No.1 Stupid
 
~Phenom~'s Avatar
 
Join Date: May 2005
Location: CYBERYARD
Posts: 1,705
Default Re: java in linux

^^just a correction , the last line should be
$java classname

this is the class having main function. The filename and classname may not be same.
__________________
n00b forever...
~Phenom~ is offline  
Old 14-01-2007, 12:27 PM   #7 (permalink)
Wise Old Owl
 
JGuru's Avatar
 
Join Date: Dec 2005
Location: Space-time continuum
Posts: 1,646
Default Re: java in linux

@Phenom, As per Sun's JAVA Language design, a Class having the main() function, must
be the name of the File!!! You can't specify any filename like in C/C++!!!
So I said "Java FileName" (To make things simpler for him).
Actually it's "Java classname".
__________________
* Imagination is more important than knowledge.
-Albert Einstein
JGuru is offline  
Old 14-01-2007, 12:44 PM   #8 (permalink)
The No.1 Stupid
 
~Phenom~'s Avatar
 
Join Date: May 2005
Location: CYBERYARD
Posts: 1,705
Default Re: java in linux

^^well , its the convention and not rule. It is strictly followed by already made classes in java but it is optional in user made programs.
__________________
n00b forever...
~Phenom~ is offline  
Old 15-01-2007, 04:04 PM   #9 (permalink)
OSS Enthusiast!
 
nitish_mythology's Avatar
 
Join Date: Sep 2005
Location: Hills of Kumaoun
Posts: 664
Default Re: java in linux

Recently I installed fc6...
I did a custom install and selected developer's tools too.
I tried to compile and exectute Java program on Eclipse and I was successful!

The only prb is tht my pc is old so eclipse was jst tooooooooo slow!
__________________
Do you know, Shinigamis only eat apples???
nitish_mythology is offline  
Old 15-01-2007, 04:25 PM   #10 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: java in linux

Distros like FC and Suse mostly give a java compiler bundled in too. If you do full install then mostly these tools are installed. It actually depends on the distro.
And nitish is it sun-java or gcj?
nitish why don't you try something that's light? You have a nice excuse to learn emacs. It will be light on resources. It does have a big learning curve though as I have heard. But you can try xemacs + jdee.
You can also use kate, but it is not an IDE just an editor with syntax highlighting.
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 15-01-2007, 05:44 PM   #11 (permalink)
Wise Old Owl
 
JGuru's Avatar
 
Join Date: Dec 2005
Location: Space-time continuum
Posts: 1,646
Default Re: java in linux

@Nitish, Use NetBeans IDE 5.0 BlueJ Edition. It's a very good Java IDE for School
students, who are learning Java. It's easy to use, also it uses very less RAM!!
Download it from here
Also read Tutorial on using NetBeans IDE 5.0 BlueJ Edition Click here
Also you must install Sun's Java JDK1.6.0. & not gcj (like @Mehul said).
Fedora Core 6 ships will gcj , not Sun's JDK!!!
__________________
* Imagination is more important than knowledge.
-Albert Einstein
JGuru is offline  
Old 17-01-2007, 03:35 PM   #12 (permalink)
OSS Enthusiast!
 
nitish_mythology's Avatar
 
Join Date: Sep 2005
Location: Hills of Kumaoun
Posts: 664
Default Re: java in linux

Well,As soon as I gt Linux installed in my computer's lab I wll try it!

Well In my home I was using SUN Java Eclipse IDE!
__________________
Do you know, Shinigamis only eat apples???
nitish_mythology is offline  
Old 17-01-2007, 07:30 PM   #13 (permalink)
In The Zone
 
Vivek788's Avatar
 
Join Date: Jul 2006
Location: Cochin
Posts: 339
Default Re: java in linux

so u mean i already have gcj but i need to install java SDK 6.0?why?
What is difference?
Vivek788 is offline  
Old 17-01-2007, 07:51 PM   #14 (permalink)
18 Till I Die............
 
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
Default Re: java in linux

Quote:
Features and Limitations of GCJ

GCJ is not only a compiler. It is intended to be a complete Java environment with features similar to Sun's JDK. If you specify the -C option to gcj it will compile to standard .class files. Specifically, the goal is that gcj -C should be a plugin replacement for Sun's javac command.

GCJ comes with a bytecode interpreter (contributed by Kresten Krab Thorup) and has a fully functional ClassLoader. The standalone gij program works as a plugin replacement for Sun's java command.

GCJ works with libgcj, which is included in GCC 3.0. This runtime library includes the core runtime support, Hans Boehm's well-regarded conservative garbage collector, the bytecode interpreter and a large library of classes. For legal and technical reasons, GCJ cannot ship Sun's class library, so it has its own. The GNU Classpath Project now uses the same license and FSF copyright that libgcj and libstdc++ use, and classes are being merged between the two projects. We use the GPL but with the special exception that if you link libgcj with other files to produce an executable, this does not by itself cause the executable to be compiled by the GPL. Thus, even proprietary programs can be linked with the standard C++ or Java; runtime libraries.

The libgcj library includes most of the standard Java classes needed to run non-GUI applications, including all or most of the classes in the java.lang, java.io, java.util, java.net, java.security, java.sql and java.math packages. The major missing components are classes for doing graphics using AWT or Swing. Most of the higher-level AWT classes are implemented, but the lower-level peer classes are not complete enough to be useful. Volunteers are needed to help out.
Read it here http://www.linuxjournal.com/comment/reply/4860
__________________
http://www.bash.org/?258908
mehulved is offline  
Old 08-02-2007, 05:29 AM   #15 (permalink)
In The Zone
 
Vivek788's Avatar
 
Join Date: Jul 2006
Location: Cochin
Posts: 339
Default Re: java in linux

Now i instaled debian and opensuse..i get java in the former but no in the latter.Unable to find pack frm dvd and on typing yast nothign happens...
Vivek788 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



All times are GMT +5.5. The time now is 06:38 PM.


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

Search Engine Optimization by vBSEO 3.3.2