I need to install the official Oracle JRE (so I can install CrashPlan, which has issues with OpenJDK), but the docs seem to be out of date for 12.2. I did have a go at that guide anyway but ran into a brick wall, so I guess it wasn’t such a good idea.
I need the JRE now but eventually would like to install the JDK so I can get into some development with Eclipse.
Thanks.
(just switched from Debian Wheezy, so please forgive me if I’m asking something that’s obvious)
So I have a script I’ve written which Ive used from I think OpenSuse 11.3 (haven’t run it 12.2 but it works on 12.1). I do like having the openjdk installed so I can play around and see differences. So I let yast take care of updating that, but for my everyday life I generally prefer or absolutely need to the sun/oracle jdk. Because of this everytime the openjdk installs it relinks the java commands in /usr/bin to itself. This script simply removes those and replaces them to where ever the version of java you want is.
#!/usr/bin/sh
JAVA=/usr/java6
echo "Java Home: $JAVA"
echo -e "Change Links [y|n]: \c "
read res
array=( java javac javadoc javah javap javaws jar jarsigner)
plugins=( libnpjp2.so javaplugin.so )
if "$res" == "y" -o "$res" == "Y" ]; then
echo "Removing Links"
echo "=============="
for i in "${array@]}"
do
rm /usr/bin/$i
echo "Removed /usr/bin/$i"
done
echo "Removing Plugins"
echo "================"
for i in "${plugins@]}"
do
rm /usr/lib64/browser-plugins/$i
echo "Removed /usr/lib64/browser-plugins/$i"
done
echo "Recreating Links"
echo "================"
for i in "${array@]}"
do
ln -s $JAVA/bin/$i /usr/bin/$i
echo "Created /usr/bin/$i -> $JAVA/bin/$i"
done
echo "Recreating Plugin"
echo "================="
ln -s $JAVA/jre/lib/amd64/libnpjp2.so /usr/lib64/browser-plugins/libnpjp2.so
echo "Created /usr/lib64/browser-plugins/libnpjp2.so -> $JAVA/jre/lib/amd64/libnpjp2.so"
else
echo "Nothing to do... Good Bye!"
fi
So its not fully featured and for the sake of the post I declared the value for $JAVA at the beginning but in my normal use I have JAVA_HOME set in my .bashrc and read that in. This requires root to run, so sudo or run as su (dont have it checking to ensure that). Then it makes sure you really want to link to your new version of java. Its also meant for 64bit, will need to be tweaked to handle the plugins correctly for 32bit.
But essentially what you do is download and extract java. Then you give this script, so set JAVA to the location of the exploded version of the jdk. And it sets up the symbolic links so that its the default jre/jdk on your system. For me I keep around java 1.5 1.6 and 1.7 along both sun and open versions where available and with this I can easily change what the systems default is.
I think you’re right about the bit above. I read the 64-bit instructions, saw the bit about removing IcedTea completely, so jumped right into YaST and removed anything that looked like java. Well… long story short and trying to figure out why I can’t get CrashPlan to work, I try downloading Eclipse to see what it reckoned, and it says the following:
“GCJ has been detected as the current Java virtual machine. Use of GCJ is untested and unsupported. Please consult the documentation for more”
I didn’t quite get to the bit shortly after the IcedTea reference that said:
Note: leave openJDK itself installed, otherwise malfunctions may occur!
So… I’d better go and put OpenJDK back and start again! Java has always been a love/hate relationship… well, more on the hate than the love side, I think. My feeble brain tells me that I shouldn’t need OpenJDK if I’m installing the real deal, but life wasn’t meant to be this easy. I’ll report back if I ever get it working, and thanks for your help.
I personally prefer to install the rpm version of jre, not the tar.gz the howto recommends.
There are less things to do, and after all, all installed packages are rpm, do not make an
exception with java.
–
Cheers / Saludos,
Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)
On 2012-09-12 13:16, marcfearby wrote:
> I think you’re right about the bit above. I read the 64-bit
> instructions, saw the bit about removing IcedTea completely, so jumped
> right into YaST and removed anything that looked like java.
You can not do that, yast will try to install any other version of java and will not recognize
jre as a java.
I still don’t get why it goes off and puts in another java when I remove OpenJDK (I thought the FOSS community was slowly but surely giving Java the cold shoulder these days anyway? why is java still so necessary?). Anyway, after putting OpenJDK back and re-installing Java, Eclipse is happy, and so is CrashPlan (though it seems hell bent on forcing me to delete 86GB of backups before transferring the license, which is not good!).
LibreOffice also complained but its message box told me to what to do so I added /opt/java/64/jre1.7.0_07 to its options window and all’s well there, too.
On 09/12/2012 01:43 PM, Carlos E. R. wrote:
> I personally prefer to install the rpm version of jre
when my bank’s computer refused to let me in with 1.6 (about a month
ago) i tried to install oracle’s 1.7 rpm using YaST, and Java wouldn’t
run…so, i then tried to use the rpm command to install it, and still
no go…so, i gave up and followed the guide previously given, and it
now works fine.
i’ll prove it works to you: gimme your bank’s web address and account
number and i’ll transfer some money to you!
oh wait, i will also need your password to make a deposit!
On 2012-09-12 14:06, marcfearby wrote:
>
> robin_listas;2486389 Wrote:
>> You can not do that, yast will try to install any other version of java
>> and will not recognize jre as a java.
>
> I still don’t get why it goes off and puts in another java
Of course it does, it is required by other apps - like libreoffice.
> (I thought the FOSS community was slowly but surely
> giving Java the cold shoulder these days anyway?
Not at all.
–
Cheers / Saludos,
Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)
On 2012-09-12 15:54, dd@home.dk wrote:
> On 09/12/2012 01:43 PM, Carlos E. R. wrote:
>> I personally prefer to install the rpm version of jre
>
> when my bank’s computer refused to let me in with 1.6 (about a month ago) i tried to install
> oracle’s 1.7 rpm using YaST, and Java wouldn’t run…so, i then tried to use the rpm command to
> install it, and still no go…so, i gave up and followed the guide previously given, and it now
> works fine.
These are my notes:
rpm --erase --nodeps java-1_6_0-sun-alsa java-1_6_0-sun-plugin java-1_6_0-sun
Download the rpm.
../jre-6u32-linux-x64-rpm.bin -> run it and it expands into jre-6u32-linux-amd64.rpm
rpm --install jre-6u32-linux-amd64.rpm
# update-alternatives --install "/usr/bin/java" "java" "/usr/java/default/bin/java" 1
# update-alternatives --set java /usr/java/default/bin/java
# update-alternatives --list java
/usr/lib64/jvm/jre-1.5.0-gcj/bin/java
/usr/java/default/bin/java
installed into "/usr/java/default".
ln -s /usr/java/default/lib/amd64/libnpjp2.so ~/.mozilla/plugins/
Verify:
http://java.com/en/download/installed.jsp
> i’ll prove it works to you: gimme your bank’s web address and account number and i’ll transfer
> some money to you!
To or from?
> oh wait, i will also need your password to make a deposit!
Nay
–
Cheers / Saludos,
Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)
>
>robin_listas;2486389 Wrote:
>> You can not do that, yast will try to install any other version of java
>> and will not recognize jre as a java.
>
>I still don’t get why it goes off and puts in another java when I
>remove OpenJDK (I thought the FOSS community was slowly but surely
>giving Java the cold shoulder these days anyway? why is java still so
>necessary?). Anyway, after putting OpenJDK back and re-installing Java,
>Eclipse is happy, and so is CrashPlan (though it seems hell bent on
>forcing me to delete 86GB of backups before transferring the license,
>which is not good!).
>
>LibreOffice also complained but its message box told me to what to do
>so I added /opt/java/64/jre1.7.0_07 to its options window and all’s well
>there, too.
>
>Thanks everyone for your help
One clue that i have sussed is that very many install and configuration
scripts use java, perl, python, ruby, and more. And a goodly chunk of
many apps are written in these languages.
Opensuse how-to describes installation of Java 7 (jdk/jre1.7.0 and later) from tar.gz, but older versions of Java are offered only in .bin and rpm.bin formats. I’ve tried to adjust that procedure but plugin names and locations are different and it all becomes a royal mess.
Java.com and Oracle.com have their own how-to but there the location of mozilla plugins is not the same as in OpenSuse 12.2.
Some say to create .mozilla/plugins folder while official OpenSuse how-to deals with /usr/lib/browser-plugins and tons of other terminal commands about slaves “javac” and “javaws” and compressing man files and what not.
I’m looking for only 32-bit jre and these instructions.
“Notes” proposed by Robin_listas two posts earlier look easy but they deal with 64-bit install and ~./mozilla/plugins instead of default OpenSuse 12.2 location.
What’s the best way to proceed? I’ve tried a couple of times but never got it working. Now I’m looking at clean 12.2 install and want to get it right the first time without leaving legacy code and simlinks all over the place.
> “Notes” proposed by Robin_listas two posts earlier look easy but they
> deal with 64-bit install and ~./mozilla/plugins instead of default
> OpenSuse 12.2 location.
32/64 bits is just a name change to you. Just use one rpm or the other.
As to the 12.2 locations I do not know that they are that different.
Al that I do is install the rpm, use the update-alternatives script, and
make sure the links for the plugins to the browser(s) exist. Really simple.
–
Cheers / Saludos,
Carlos E. R.
(from 11.4 x86_64 “Celadon” (Minas Tirith))
Packages from both oracle and java websites have no Sun/Oracle reference in their names while those in software.opensuse are all from Sun. I guess they simply don’t exist anymore on download websites used by .ymp installers. One click install, though, sounds yummy.
One question before I try to install .rpm.bin package - how can I restore my system if anything goes wrong? Would it be uninstallable from yast/zypper? How to remove link to plugin? It’s not registered with yast, is it? If I decide to go back to Icedtea, what would I have to do?
Also - would modifying simlink to “ln -s /usr/java/default/lib/…whatever…/libnpjp2.so /usr/lib/browser-plugins” work for all 12.2 browsers, not just Firefox?