Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

The installation steps of a JDK6 for:

are quite straightforward but:

  • are in two separate documents
  • do not deal with local zone (container) installation
  • do not address fully non-standard installation path

The answer below is a community-wiki one, meant to be edited.

Do you have any comments/remarks we all should know when installing JDK on a Solaris10 sparc server?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

Since 2009 (time of my first answer), I found out that the self-extracting scripts were perfectly compatible with non-standard path (like installing a JDK in a user's $HOME/usr/local for instance, instead of the system path /usr/local)

The latest Oracle JDK download page lists:

Solaris SPARC - Self Extracting Binary        86.05 MB  jdk-6u26-solaris-sparc.sh
Solaris SPARC 64-bit - Self Extracting Binary 12.24 MB  jdk-6u26-solaris-sparcv9.sh

You need to be careful if you copy them from Windows to your server (with winscp for instance): you need to copy those two sh scripts as binary (or they won't work once copied on the Unix server).

Once on the server, you need to chmod 755 the two .sh (the second being needed only if you have a 64-bit Solaris).
Execute them both (for instance in $HOME/usr/local, as the user without needing any root privilege), first jdk-6u26-solaris-sparc.sh, then if needed jdk-6u26-solaris-sparcv9.sh.

That will create a $HOME/usr/local/jdf1.6.0_26 in which you have a fully operation JDK.

  • no root right necessary (contrary to pkgadd)
  • no environment variable modified: you will need to add $HOME/usr/local/jdf1.6.0_26/bin to your $PATH if you want to use that particular JDK, but the point is:
    this installation won't disturb any of your current environment settings.
    (note: the JAVA_HOME isn't set of course, but it never is by any installation process anyway)
share|improve this answer

Update 2011: see my updated answer: no more sudo pkgadd necessary.


First answer in 2009:

There are two methods for installing a JDK:

  • Self-extracting binary (shell script)
  • Solaris packages (pkgadd command)

Since the Self-extracting binary is not meant to be configured to install in non-standard path, I would recommend the later one (packages).

You need to download:

  • jdk-6u16-solaris-sparc.tar.Z (main package, used for 32-bits installation)
  • jdk-6u16-solaris-sparcv9.tar.Z (small package, used for 64-bits additional-step installation)

Since the content extraction of those compressed archives creates files directly in the current directory, I would advise moving each archive in its dedicated repository

$ mkdir jdk-6u16-solaris-sparc
$ mv jdk-6u16-solaris-sparc.tar.Z jdk-6u16-solaris-sparc
$ cd jdk-6u16-solaris-sparc
$ zcat jdk-6<update>-solaris-sparc.tar.Z | tar -xf -
$ cd ..
$ mkdir jdk-6u16-solaris-sparcv9
$ mv jdk-6u16-solaris-sparcv9.tar.Z jdk-6u16-solaris-sparcv9
$ cd jdk-6u16-solaris-sparcv9
$ zcat jdk-6<update>-solaris-sparcv9.tar.Z | tar -xf -

What is not mentioned in the documentation is the case when you need a local installation (in a local zone), separate from a global JDK already installed in /usr/java (/usr is not writable from a local zone).

the '-R' option of pkgadd comes in handy in this case.

$ cd jdk-6u16-solaris-sparc
$ sudo pkgadd -R /MY_REP -d . SUNWj6rt SUNWj6dev SUNWj6cfg SUNWj6man SUNWj6dmo
$ cd ../jdk-6u16-solaris-sparcv9
$ sudo pkgadd -R /MY_REP -d . SUNWj6rtx SUNWj6dvx SUNWj6dmx

Here JDK6 is installed under:

/MY_REP/usr/jdk/instances/jdk1.6.0

/MY_REP/usr/java -> jdk/jdk1.6.0_16/
/MY_REP/usr/jdk/jdk1.6.0_16 -> instances/jdk1.6.0/

No need to "root shell" (which is 'evil' anyway) as mentioned by the Sun documentation:
a 'sudo root pkgadd' is enough.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.