Last Edited: 01 May 2008 by superuser
Importered from old WiKi -- 30/04-08 17:04.

How To Install Java In Puppy

There are two main ways to install java. Installing the JDK and the JRE. The JDK is the Java Developers Kit, it contains all the tools necessary to compile java programs. Most people only need the JRE, which is the Java Runtime Environment. Both the JRE and the JDK allow you to run Java programs.

Note: To install the JRE try this .pup∞. It needs about 100MB of space. For more info search for 'java' on this page

Installing the JDK (only for developers) with GuestToo's installer

You only need the JDK if you are a developer and want to compile Java programs. If you just want to run Java programs, you only need the JRE which is smaller.

I did install the JDK on Puppy. As far as I remember, I did the following.

1) Went to http://packages.slackware.it∞ and downloaded jdk-1_5_0_09-i586-1.tgz

2) created directory /tmp/java and moved jdk-1_5_0_09-i586-1.tgz into that directory. Then opened terminal window in that directory (in ROX, just press ` ) and said gunzip jdk-1_5_0_09-i586-1.tgz and
tar -xvf jdk-1_5_0_09-i586-1.tar

3) moved the folder /tmp/java/usr/lib/jdk1.5.0_09 into /usr/lib/ (I did it using ROX; I do not know how to copy folders from the command line; perhaps cp -ra but I am not sure. In ROX you just drug and drop)

4) moved the file /tmp/java/install/doinst.sh to / and then opened the terminal window in / and said:
sh doinst.sh
(read doinst.sh before doing it)

5) Following the instructions in the file /tmp/java/etc/profile.d/jdk.sh I added these lines to the file /etc/profile.local :

export JAVA_HOME=/usr/lib/java
export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
export MANPATH=$MANPATH:/usr/lib/java/man

Then, if you also want to install the java plugin for the browser, read the instructions here:
http://plugindoc.mozdev.org/faqs/java.html

These are instructions to install Sun's Java 1.5.0_02 in Puppy Linux (run time only)

  • Click the Install Java button
  • You need about 100 megs of free space
  • The Sun Java installer is 25 MB
  • The Java folder will be about 85 MB

image

  • Click the Continue button

image

  • Press the space bar repeatedly to read the iicence agreement
  • Type yes then press the enter key

image

  • If Java installs ok, you should see this:

image

  • Click Yes if you want to delete the Sun installer
  • If you click No, you can reinstall Java without needing to download it again

image

  • If you have Firefox or Mozilla, a window should open showing your plugins

    • You should see the Java plugins in the list
  • There should also be a window showing a Java plugin test page
    • It should look like this:

image

  • It may be necessary to Enable Java in your browser
  • To enable Java in Firefox:
    • Click Preferences in the Edit menu
    • Click Web Features
    • Check the box for Enable Java

image

  • Java should now be installed and the browser plugin for Firefox and Mozilla should work
  • You need to reboot before you run Java programs from your hard drive
  • The command for running a Java program is java -jar your-program.jar
  • The Rox-filer Set-Run-Action for a jar file should be java -jar "$1"


I've just installed the current Java Runtime Environment (1.6.0.02) into Puppy 2.17.1 (with WhoDo's EZPup 2.1.7R2) directly from Sun, no dotpup involved. Here's the procedure. I composed this so a French-speaker can translate it using Babelfish:

1. Open Seamonkey. Surf you to
http://www.sun.com/

2. In the lower right, press "Java for games, apps, and a whole lot more."

3. Press you the green "Free Java Download" button.

4. Press you the green down-arrow "Linux (self-extracting file)" button.

5. A dialog box opens, "Opening jre-6u2-linux-i586.bin".

6. Be sure that "Save it to disk" is highlighted.

7. Click you the "OK" button.

8. Click you the "Browse for other folders" line.

9. In the left window, double-click "File System".

10. Grab the "Enter name of file to save to..." window's title bar and move the window to the center of your screen.

11. In the right window, scroll down to "usr" and doubleclick.

12. Scroll down and doubleclick "local".

13. Scroll down and doubleclick "bin".

14. Click you the "Save" button.

15. Wait you for the 18+MB download to conclude. You will see the download's progress in the "Download Manager" window, which you can see by pressing the tiny green down-arrow on the taskbar.

16. Open you Puppy's lower-left Menu (Start) button, Filesystem - Rox-Filer file manager.

17. Press you the up arrow at top left of the Rox window. This places you in / .

18. Click you the "usr" icon.

19. Click you the "local" icon.

20. Click you the "bin" icon.

21. Right-click the icon for jre-6u2-linux-i586.bin (which you have just downloaded).

22. Highlight "File 'jre-6u2-linux-i586.bin'" and roll you the mouse to the right and roll to "Properties" .

23. Left-click "Properties" .

24. Click you the checkbox "Exec" (=make executeable) in the "Owner" row.

25. Click the Close button.

26. Right-click in the whitespace of the /usr/local/bin Rox window.

27. Roll down to "Window" and slide the mouse right and to "Terminal here" .

28. Left-click "Terminal here" .

29. At the # prompt, issue the command

./jre-6u2-linux-i586.bin

30. You see the license. Repeatedly, but slowly, press the "Page Down" key until you see the word "More" no longer.

31. Now you see "Do you agree to the above license terms? [yes or no]"

32. Press y {enter} .

33. Now Java unpacks. In a minute you see "Done."

34. Menu - Filesystem - Rox-Filer

35. Up-arrow usr lib mozilla plugins

36. Right-click in whitespace in this Rox window, Window-->Terminal here .

37. Create you a symbolic link: issue you this command:

Code:
ln -s /usr/local/bin/jre1.6.0_02/plugin/i386/ns7/libjavaplugin_oji.so ./libjavaplugin_oji.so

38. Click you in Seamonkey

Edit - Preferences - Advanced (click on the word "Advanced") - click the "Enable Java" button.

39. Click you in Seamonkey

Edit - Preferences - Advanced (click on the + sign) - Scripts and Plugins

40. Be sure that "Enable JavaScript for Navigator" is checked.

41. Edit - Preferences - Advanced (on the + sign) - Cache - Clear Cache

42. Close Seamonkey and restart it.

42. Now surf to

www.sun.com

43. At the lower right, click "Java for games, apps, and a whole lot more"

44. Click the tiny "Do I have Java?" phrase.

In a few seconds, you should see "Congratulations!"

Now you have Java.



CategoryHowto