Java Compiler in Ubuntu?
Hi to all, I have a brief question:
When I type something that should be put in terminal, I use quotations, DO NOT use the quotations, I only use them to emphasise that what is inside the quotations should be typed as it is viewed by the reader, or to display the exact message that appears due to a command given. How do I know if I have a Java Compiler in my Ubuntu Distribution? For example, I know that most Linux (IFF not all) Distributions come with a C compiler (in my case, GCC). So, in order to check for a GCC compiler, all you do is go to (in Ubuntu 8.10) Applications>Acessories>Terminal, and type in: "gcc" (Without quotations, of course) If the GCC compiler is installed, you get a message that says: "gcc: no input files" (Again, you wont see quotations) Is there any similar way to do something like that for Java? If you need more information to answer my question, let me know, in detail, and I will provide it. Rock on dudes and dudettes! Peace, MexDeath |
Following your method :D, in the terminal try
Code:
javac Code:
dpkg -l Code:
which javac Cheers:) |
java -version
|
Quote:
Quote:
|
Quote:
Here is what I get: Quote:
|
Quote:
I wont quote 1k plus lines of terminal output on this thread :p |
You want the sun-java6-jdk or the open source openjdk-6-jdk.
|
Choosing one.
Quote:
Well, what is the difference, actually, which is more reliable? Sun's or Open? Also, like with OpenOffice, is this openjdk-6-jdk some sort of a project by Sun? In either case, what do I do to use it? Do I have to instal it? Im relatively new to Linux (6 Months) and I have no clue as to what I should do after choosing any of them. "Them" being (for anyone that wants to kick into this subject and help me out): 1. sun-java6-jdk or 2. openjdk-6-jdk Basically, my questions are: 1. What is the difference? 2. Does it matter? 3. How do I instal (If it isnt already)? 4. How do I make it work? Thank you all! :D |
1. The Java language was invented and developed by Sun (yep, the guys who are also involved in Open Office). For many years, it was a proprietary language, which meant that it could not be freely distributed. This gave rise to open source alternatives that sought to reimplement the Java API. Most of these, however, were incomplete or lagged or had some other drawback so the Sun JDK remained the standard. Just last year, Sun changed their mind and released their JDK as open source. Now the problem is that some of the code in the Java API is owned by others and cannot be open sourced whether Sun want to or not. That is where the openjdk comes in: it seeks to rewrite those proprietary componenents in order to produce a jdk that is 100% as functional as the whole sun jdk without any proprietary element whatsoever.
2. For most purposes, no. The sun jdk does remain the reference implementation, though. 3. sudo aptitude install name_of_package (e.g. sudo aptitude install sun-java6-jdk). 4. nothing, on ubuntu, it should just work after doing 3 if you have not got any java package installed yet. If you have, then you need to switch the default (you can use galternatives to do so). |
Thanks Jay, I'll see what happens...
Everybody put your helmets on! |
About my Java Compiler.
Alright, so, as "Jay73" said, I ran the following command:
Code:
sudo apt-get install sun-java6-jdk Code:
javac Code:
mexdeath@mexdeath-desktop:~$ javac |
Never Mind... that is it. I got it to work. Thank you all.
|
All times are GMT -5. The time now is 03:10 AM. |