Fr Chris' Linux Help

Who this is for

The cheaper computers get, the more likely it is that you get somebody's old computer donated to you to play with. This machine won't do well with the current versions of games, and I don't see you going out and spending hundreds of dollars to buy XP, Some Anti-virus utility and a full legal version of Office (*PLEASE respect the law--use freeware, donate to the programmer that wrote the shareware you use, and buy your commercial software!!!!*). This is especially true if you already have a computer with all that. But though the price of hardware goes down, the cost of software seems to stay the same or go up --- unless it is open source (ever here of the GNU lincense?).

You can learn alot by compiling your own kernel and figuring out how to custumize your menus and load them up with your own icon that *you* designed. You learn a lot by looking at someone else's source code and tweaking it to make it your own (without worry of violating the law!)

My point is, why not install linux on some old hand-me-down machine, where if you screw up, you don't mind reformatting the hard drive!

Linux comes in many flavors, and many a teenager becomes a master by reading the HOWTOS and the message boards--You know, the guy who actually *reads* the README files. This is web page not for you. You can probably teach *me* a lot.

There is a lot of good links for getting your OS up and running, and this not the page for you. This is a simple web page to help you get started installing and configure your OS with the things that we'll be using in class: Java JDK 1.5, JEdit, BlueJ, and learning some tricks along the way. I'll tell you how to costumize your KDE Desktop so it's easy to start things up without opening a shell and typing it by hand. My hope is that you'll discover the way this OS works so you have no fear experimenting.

What you'll need

You really do need a good internet connection, since you'll be downloading a lot. I like to have a working computer in the same room so I can do something while something is downloading. I need to take notes (my memory is good, just not long!). For simplicity I'm going to tell you exactly how I set up *my* computer, and if this is your first linux experience, just do as I do. If you'd like, you can adapt what I do--there are MANY different choices every step along the way, so I'm just telling you the way that worked for me.

If you're going to do what I do, get (borrow or download) a SuSe 9.3 or 10.1 (or 10.2 the bleeding edge version) installation DVD. It's perfectly legal to burn a copy of someone else's. I down loaded mine from http://en.opensuse.org/Download. There are many fine distributions, and you can find them all with the help of Google! Depending on your hardware, one version may be more problematic for you than another (for example my WiFi worked fine in SuSe 9.3, but not at all in 10.1). linuxquestions.org is great for finding help resolving various problems.

One nice Installation guide is here. I like installing from a DVD so you don't need to worry about a dropped internet connection or waiting around and feeding the computer its next CD---but it literally takes a day to download! Just for fun I followed Nilesh Bansal's instructions to see if I can install it on my MacBook (Dual Intel CPUs with Parallels Desktop--version 9.3 is supported but not 10.1--I wonder why... maybe I'll find out!). Anyway, after a quick d/l and burn of the net install CD, it booted fine. I had to press the "Back Up" to load a network card module (the ne2000PCI module) after that it was only a 2 hour download rather than a 13 hour DVD download!....but I digress...

Start YaST and update your OS. You may need to restart your machine if it needs to update your kernel or YaST. Eventually, you want to use YaST to install or update to the current java (1.5) and FireFox.

At this point let's assume you have FireFox up and running. Start FireFox and go to http://java.com/en/download/installed.jsp to verify if you have the latest java (at the time of writing this it's 1.5), and/or if you need to tell FireFox where your Java lives on your computer. Click on the orange Verify Installation rectangle.

Installing FireFox without YaST

Installing FireFox without using YaST is another way to go. Just skip to the BlueJ section now if you want to use YaST. The Firefox installation might be a good introduction to Linux software if you never installed anything "Linux" style.

Click in the blue "globe" with the gear (Konqueror is a file and internet browser) and go to "http://www.getfirefox.com", and if all is well (ie, you have a funtional internet connection) you have the internet page open.

Extract the tar ball

In general, when you download a program, it needes to be expanded (or unzipped). I saved the file to /home/<your user name >/Documents If you click on the House Icon, by default it opens your home folder in a browser, and you can select Documents. Start a Terminal shell here by pressing the F4 key (or by clicking on the Tools menu and selecting Open Terminal). You can list all the files by typing in the Terminal:

ls -la

To extract, type:

tar -xzvf firefox-1.5.0.6.tar.gz

(or whatever the version you have--the name might be slightly different). This will create a firefox subdirectory. Now type:

cd firefox

Then

./firefox

to execute.

Is it executable?

This was an easy example since the subfolder had a file that was already set to be an executable. Usually you have to manually permit this do this by setting a bit...the executeable bit.

I presume you prefer using a mouse rather than typing

chmod 655 firefox

To use your mouse, click on the blue house (Your home directory) on the lower left. Right click on the file you downloaded, select the Prefrences tab, and check the executable box.

If you need more power...

Sometimes an ordinary user don't not have enough permissions to install everything where it should. A lot of places are owed by the root user, and you cannot write files or folders there. All you have to do is become a "Super User"

You can start a Terminal Shell (F4 or by clicking on the Tools menu and selecting Open Terminal) )--- this is like "Terminal" in OSX, or "Command Console" in Windows, (or "DOS" in DOS!). Many directories are protected in linux, so you want to log in as "super user" (aka "root") to write anything that is really important. To do this type "su" then it asks for a password (the one you typed when you installed linux at the root user's password).

To execute a file in the current directory type a period and a forward slash followed by the file name. Now file names in linux can be long, frightening, and difficult to type... so I don't. Drag the file from the Konqueror Window (The File Browers that was opened when you clicked on the Blue House) to the terminal Shell's window, and the pop-up menu offers you a chance to Paste the file name. I then use the arrows and backspace key to edit the line.

Of coarse, if you type better than me, you could have just used your keyboard...but sometimes these file names get really complicated, and it's good to know how to paste the name from one window to your shell.

You can copy and paste within your shell window too. To see the files in your current directory, type

ls

(this is like "dir" in DOS). You then could have copied and pasted the long filename from this listing.

Installing BlueJ in linux

  1. Install Java JDK 5.0 ( aka 1.5) and Firefox, if you haven't already. If you're using SuSe, the quick, easy and reliable way is with YaST.

  2. First, let's download a pretty icon for us to use later in our installation. Steer your web browswer to http://www.bluej.org/bluej-icons/


    click on one

  3. Save the image as bluej-logo.png

  4. . I put it in /home/<your-name>/Documents and named it bluej-icon.png


  5. Download BlueJ (The linux friendly .jar version from BlueJ.org with FireFox, but when the download completes, do not open the file, instead right-click and select Open Containing Folder (You can see here that I just put the installer on my Desktop, but it doesn't really matter)


  6. Okay, you should see the bluej-213.jar right-click and select OPEN WITH...

  7. and type java -jar

    (I can hear someone already to telling you the proper "nerd" way to do this... yes, yes, real men type, rather that use their mouse... if you are in the File Browser, pressing the F4 key opens a Terminal (or Shell) Window with the directory you are currently browsing. Then you call the blueJ installer by typing java -jar bluej-213.jar)

  8. If all is well, you should see:

    Now the defaults should be fine, so just click INSTALL

    Now any old-school-Linux guy would be cringing right now, due to the fact that we are not installing this in /usr/local/bluej or some such normal location, and then later adding this new directory to your $PATH. However, just trust me, the default home directory is better for playing with the examples later... wouldn't it be sillier to have to log in as root or su to simply compile an example?)

  9. Okay, next step is to show you how to add this to your KDE menu, so you can start BlueJ from anywhere...Right-click on the green lizard (where the start menu would be if you were in Windoze), and you can select Menu Editor

  10. Select Development

  11. then New Item

  12. Now to use that pretty icon we saved at the very beginning, click on the default icon and press the BROWSE button

  13. Do you remember where you put it? Select the file and you see the BlueJ logo, then press OPEN

  14. Now we press the folder button next to Command:

  15. If you used the default location, it should be easy to find in the "bluej" folder of your home directory

  16. If you want you can select the Work path: as well.

  17. I selected the ChapterProgs folder I downloaded from stfrank.com

  18. Now save what you have!

  19. And there it is in the KDE Menu! Let's see if it works!

  20. Now we'll create a new project in BlueJ

  21. and import the Chapter3 Programs... I called my Project BJChap03

  22. Now import

  23. Remember to select the folder , not a file!

  24. BTW, BlueJ has a "command-line" type interpreter so you can do Java with out being in a class or defining a main method. To turn it on, select from the VEIW menu Show Code Pad

  25. Try it out!

  26. See what you get?

  27. After the import, each file has a class defined, and BlueJ shows you the class with a box. Double-click the Java0301 box and you should see the code:

    Press the COMPILE button

  28. Go back to the Project window, and you can see that your Java0301 box lost its lines (you compiled it, and now there is a .class file with executable bytecode), and can right-click the box to call the main method:

  29. There are now cammand line arguments to pass, so just pressOK

  30. and you'll see a and b

    Notice that you can see see the previous output from what we typed in the Code Pad in step 25

  31. The linux version doesn't know what web-browser to use, so we need to change something in the bluej.defs file that is in the lib folder. In the File Browswer, right-click and select Open with..KWrite

  32. Well if you have good eyes, look for and change browswerCmd1=firefox $

  33. But you can change bluej.defs in any text editor. Here I'm useing JEdit:

  34. On line 114 you can further customize the BlueJ menubar. Here I've Added a link to our Class' Web site

  35. Restart BlueJ and you can see the HELP menu has our new items!