Thursday, May 17, 2007

Guide to install complier for C/C++ and Java - Ubuntu Forums

Guide to install complier for C/C++ and Java - Ubuntu Forums

After a long time of searching and testing, I managed to install the JDK and gcc for programming practice. Here is the summary of my experience. I hope it can help you and save your time.

If you want to program with C/C++ please do the following:

sudo apt-get install build-essential

this will install the header files, make and debugger for C/C++. You can now programming with C/C++
(p.s. the command above was taken from http://www.ubuntuforums.org/showthread.php?t=106574#4 )


To those who want to install the Blackdown JDK 1.4.

1. You need to enable multiverse and universe first. This link http://help.ubuntu.com/starterguide/...addinguniverse will guide you to do so.
2. Search for j2sdk1.4 and install that package.


To those who want to install the lastest Sun JDK 1.5 update 6.

1. Goto http://java.sun.com/j2se/1.5.0/download.jsp.
2. Select the "Download JDK 5.0 Update 6"
3. Download the "Linux self_extracting file". Not the RPM one. (64 bit user please download the "Linux AMD64 self_extracting file".
4. Move the bin file to the directory wherever you like.
5. On the command line. type "./filename" where the filename is the bin file you downloaded. Make sure you have the execute permission for this file.
6. Add the of path to the $PATH. The path depends on where you put the bin file. For example, if you put the bin file in "/usr/lib/", then the whole path should be "/usr/lib/java/bin".


Install Sun JDK as a debian package
1. Goto http://java.sun.com/j2se/1.5.0/download.jsp.
2. Select the "Download JDK 5.0 Update 6"
3. Download the "Linux self_extracting file". Not the RPM one. (64 bit user please download the "Linux AMD64 self_extracting file".
4.make sure you install fakeroot package.
5.chmod +x to the bin file you just download
6.type "fakeroot make-jpkg {the bin file name}", this will create a debian package
7.type "sudo dpkg -i {the deb file name}", this will install the debian package you created. You can now program with java
8.finally, move the deb file to /var/cache/apt/archives/ directory. This is optional.


Setup the PATH for java etc..
This is easy. Type
sudo update-alternatives --config java
a list of options will be display, pick the java you want to use by putting a number.
EEEEEEEEEasy

There are many ways to add the path to $PATH. You can either do it in ~/.bashrc or /etc/skel/.bashrc or /etc/bash.bashrc
Please feel free to ask any question if you get confuse

To check which java you are using, type "java -version". Check the version display to see if it is what you want. Set the PATH again if it is not the java you expected.



Also, if I made any mistake here or you know a better way to install, PLEASE reply and let us know. Thanks

More information here http://java.sun.com/j2se/1.5.0/insta...elf-extracting
and here http://www.docuverse.com/blog/donpar...b-3aba4ad32c52
__________________
Although there is a long long way to go, I believe we will reach the goal.

HOWTO install gcc and JDK
http://www.ubuntuforums.org/showthread.php?t=107569


Thanks for the Guide
I think there is a better way (and little bit longer) to install Java (and related IDEs) :
1.http://www.docuverse.com/blog/donpar...b-3aba4ad32c52
2.http://blogs.sun.com/roller/page/col...on_ubuntu_part

No comments:

如何发掘出更多退休的钱?

如何发掘出更多退休的钱? http://bbs.wenxuecity.com/bbs/tzlc/1328415.html 按照常规的说法,退休的收入必须得有退休前的80%,或者是4% withdrawal rule,而且每年还得要加2-3%对付通胀,这是一个很大...