[Bug 722252] New: alljava.sh does not work for third-party JVMs
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c0 Summary: alljava.sh does not work for third-party JVMs Classification: openSUSE Product: openSUSE 11.2 Version: Final Platform: Other OS/Version: Other Status: ASSIGNED Severity: Major Priority: P5 - None Component: Basesystem AssignedTo: mvyskocil@suse.com ReportedBy: mvyskocil@suse.com QAContact: qa@suse.de Found By: --- Blocker: --- Script alljava.sh assumes the JVM is installed in SUSE expected location /usr/%lib/jvm/ and if not, then JAVA_HOME et all are not installed. This does not work for third-party JVMs, which are obviously installed into /usr/java/latest or /usr/java. Solution is to extend the alljava.sh and alljava.csh to check them and add a check for /usr/lib/jvm on 64bit systems as well, as only SUSE installs the 64bit jvm under lib64. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c1 Daniel Pecka <nettezzaumanaa@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nettezzaumanaa@gmail.com --- Comment #1 from Daniel Pecka <nettezzaumanaa@gmail.com> 2011-10-05 11:39:25 UTC --- hello boys .. i'm also affected with *our java from sun (oracle): # zypper --no-ref se -s java*sun | perl -ne 'print if /^i/' i | java-1_6_0-sun | package | 1.6.0.u26-0.2.1 | x86_64 | Updates for openSUSE 11.3 11.3-1.82 i | java-1_6_0-sun | patch | 4694 | noarch | Updates for openSUSE 11.3 11.3-1.82 i | java-1_6_0-sun | patch | 4493 | noarch | Updates for openSUSE 11.3 11.3-1.82 i | java-1_6_0-sun | patch | 3969 | noarch | Updates for openSUSE 11.3 11.3-1.82 i | java-1_6_0-sun | patch | 3784 | noarch | Updates for openSUSE 11.3 11.3-1.82 i | java-1_6_0-sun | patch | 3354 | noarch | Updates for openSUSE 11.3 11.3-1.82 i | java-1_6_0-sun | patch | 2796 | noarch | Updates for openSUSE 11.3 11.3-1.82 i'd also propose that our packages with java (sun|openjdk) create legacy symlink at least to: /usr/java -> /usr/lib64/jvm /usr/java/latest -> /usr/lib64/$real_latest etc .. regards, daniel -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c2 --- Comment #2 from Daniel Pecka <nettezzaumanaa@gmail.com> 2011-10-05 12:02:34 UTC --- # file /usr/lib64/jvm/java/bin/java /usr/lib64/jvm/java/bin/java: cannot open `/usr/lib64/jvm/java/bin/java' (No such file or directory) ^^ ps. this is broken symlink .. not sure but i believe (wild guess) that's some relict after uninstallink openjdk ... the result is clear, if the openjdk is uninstalled the /etc/profile.d/alljava.sh comes broken no matter that you could have several java versions elsewhere .. let's say in **standard paths. another example: if you download eclipse|netbeans from vendor, they are expecting sun java or at least correct environment vars .. they are looking by default to /usr/jdk, /usr/jdk/latest, /usr/java .. etc these paths does not exist with **our java bundle regards, daniel -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c3 --- Comment #3 from Michal Vyskocil <mvyskocil@suse.com> 2011-10-05 12:36:43 UTC --- Created an attachment (id=454622) --> (http://bugzilla.novell.com/attachment.cgi?id=454622) Proposed alljava.sh New alljava.sh try to find more locations /usr/lib64/jvm, /usr/lib/jvm, /usr/java/latest and /usr/java and there dirs java, jre and others. It stops when identify the first installed bin/java and setup the JAVA_HOME. In case bin/javac is also found, then the JDK_HOME and SDK_HOME are already setup. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c4 --- Comment #4 from Daniel Pecka <nettezzaumanaa@gmail.com> 2011-10-05 13:33:32 UTC --- hmm .. it's not so easy and it still doesn't work optimally. we must not distinguish jre and jdk as two separete products .. jdk **contains full jre (some legacy compatibility): # md5sum /usr/jdk/latest/jre/bin/java /usr/jdk/latest/bin/java 681f66bbd29b5277519b169b03b988fc /usr/jdk/latest/jre/bin/java 681f66bbd29b5277519b169b03b988fc /usr/jdk/latest/bin/java so the JAVA_HOME env should point to /usr/java symlink created by our rpm. on solaris (or after using rpm from sun) it looks like this: # ls -l /usr/java /usr/jdk/latest lrwxrwxrwx 1 root other 15 Jul 21 11:48 /usr/java -> jdk/jdk1.5.0_30 lrwxrwxrwx 1 root other 11 Jul 21 12:45 /usr/jdk/latest -> jdk1.6.0_26 in suse it should looks like this (in case of installed jdk): # ls -l /usr/java /usr/jdk/latest lrwxrwxrwx 1 root root 16 Oct 5 14:02 /usr/java -> jdk/jdk1.6.0_27/ lrwxrwxrwx 1 root root 12 Oct 5 14:00 /usr/jdk/latest -> jdk1.6.0_27/ so JAVA_HOME has nothing to do with lookin for jre|jdk .. JAVA_HOME just should be /usr/java which is symlink to your actual jdk|jre instance. please note, that original java package from oracle contains $root/jre <- yes, it's stupid and messy so our current /usr/lib64/jvm/java-1.6.0-sun-1.6.0/jre is *bad filesystem layout. i don't think that's good way to tweak it in alljava.sh .. we should fix java-1_6_0-sun-1.6.0.u26-0.2.1.x86_64 that it creates standard symlink /usr/java. regards, daniel -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c5 Michal Vyskocil <mvyskocil@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #454622|0 |1 is obsolete| | --- Comment #5 from Michal Vyskocil <mvyskocil@suse.com> 2011-10-05 13:45:02 UTC --- Created an attachment (id=454640) --> (http://bugzilla.novell.com/attachment.cgi?id=454640) Improved alljava.sh This is fixed version of alljava.sh * allows JAVA_HOME=/usr/java * jre search is moved on the end, so all jdks can be found earlier * ignore java and jre dirs from ls output -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c6 --- Comment #6 from Daniel Pecka <nettezzaumanaa@gmail.com> 2011-10-05 13:48:51 UTC --- great .. seems like it works now quite reasonably .. regards, d -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c7 --- Comment #7 from Michal Vyskocil <mvyskocil@suse.com> 2011-10-11 09:05:27 UTC --- Created an attachment (id=455564) --> (http://bugzilla.novell.com/attachment.cgi?id=455564) Equivalent alljava.csh This is the equivalent for (t)csh -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c8 Michal Vyskocil <mvyskocil@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P4 - Low Status|ASSIGNED |NEEDINFO InfoProvider| |werner@suse.com --- Comment #8 from Michal Vyskocil <mvyskocil@suse.com> 2011-10-11 09:15:39 UTC --- Werner, would you be so nice and review attached alljava.csh? I hope it's correct equivalent of the new alljava.sh, but my csh-fu is very limited. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c9 Dr. Werner Fink <werner@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED InfoProvider|werner@suse.com | --- Comment #9 from Dr. Werner Fink <werner@suse.com> 2011-10-11 10:08:19 UTC --- Created an attachment (id=455616) --> (http://bugzilla.novell.com/attachment.cgi?id=455616) alljava.csh You may try this ... btw. why do you metion that PATH is affected ... the only variables used are JDIR and JPATH which are IMHO simpy helpers and therefore can be unset at the end. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c10 Michal Vyskocil <mvyskocil@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED --- Comment #10 from Michal Vyskocil <mvyskocil@suse.com> 2011-10-12 13:25:31 UTC --- (In reply to comment #9)
Created an attachment (id=455616) --> (http://bugzilla.novell.com/attachment.cgi?id=455616) [details] alljava.csh
Great, thanks a lot!
You may try this ... btw. why do you metion that PATH is affected ... the only variables used are JDIR and JPATH which are IMHO simpy helpers and therefore can be unset at the end.
I did not change the comment, so this is some relict from previous version. I changed that and sent the patch to aaa_base by email. Marking a bug as FIXED -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c11 --- Comment #11 from Bernhard Wiedemann <bwiedemann@suse.com> 2012-01-20 12:00:11 CET --- This is an autogenerated message for OBS integration: This bug (722252) was mentioned in https://build.opensuse.org/request/show/100859 Factory / aaa_base -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c12 Stefan Seyfried <seife@novell.slipkontur.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED CC| |seife@novell.slipkontur.de Resolution|FIXED | --- Comment #12 from Stefan Seyfried <seife@novell.slipkontur.de> 2012-01-27 08:27:35 CET --- Broken: susi:~/rpmbuild/BUILD/rxtx-2.2pre2> grep 3D /etc/profile* -r /etc/profile.d/alljava.sh: export JAVA_BINDIR=3D$JPATH/bin /etc/profile.d/alljava.sh: export JAVA_ROOT=3D$JPATH /etc/profile.d/alljava.sh: export JAVA_HOME=3D$JPATH /etc/profile.d/alljava.sh: export JRE_HOME=3D$JPATH /etc/profile.d/alljava.sh: export JRE_HOME=3D$JPATH/jre /etc/profile.d/alljava.sh: export JDK_HOME=3D$JPATH /etc/profile.d/alljava.sh: export SDK_HOME=3D$JPATH susi:~/rpmbuild/BUILD/rxtx-2.2pre2> rpm -qf /etc/profile.d/alljava.sh aaa_base-12.1-126.1.x86_64 "3D" is not a proper path on my machines. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c13 --- Comment #13 from Stefan Seyfried <seife@novell.slipkontur.de> 2012-01-27 08:41:21 CET --- proposed diff: Index: b/files/etc/profile.d/alljava.sh =================================================================== --- a/files/etc/profile.d/alljava.sh +++ b/files/etc/profile.d/alljava.sh @@ -9,37 +9,37 @@ # JDK_HOME, SDK_HOME # for JDIR in /usr/lib64/jvm /usr/lib/jvm /usr/java/latest /usr/java; do - if ! test -d $JPATH; then + if ! test -d $JDIR; then continue fi for JPATH in $JDIR $JDIR/java `ls -I 'java' -I 'jre' -d $JDIR/* 2>/dev/null` $JDIR/jre; do if ! test -x $JPATH/bin/java ; then continue fi - export JAVA_BINDIR=3D$JPATH/bin - export JAVA_ROOT=3D$JPATH - export JAVA_HOME=3D$JPATH + export JAVA_BINDIR=$JPATH/bin + export JAVA_ROOT=$JPATH + export JAVA_HOME=$JPATH unset JDK_HOME unset SDK_HOME case "$JPATH" in *jre*) - export JRE_HOME=3D$JPATH + export JRE_HOME=$JPATH ;; *) - export JRE_HOME=3D$JPATH/jre + export JRE_HOME=$JPATH/jre # it is development kit if [ -x $JPATH/bin/javac ] ; then - export JDK_HOME=3D$JPATH - export SDK_HOME=3D$JPATH + export JDK_HOME=$JPATH + export SDK_HOME=$JPATH fi ;; esac done Submitrequest against Base:System will follow soon if a smoketeset goes OK. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c14 Stefan Seyfried <seife@novell.slipkontur.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Basesystem |Basesystem Version|Final |Factory AssignedTo|mvyskocil@suse.com |bnc-team-screening@forge.pr | |ovo.novell.com Product|openSUSE 11.2 |openSUSE 12.2 --- Comment #14 from Stefan Seyfried <seife@novell.slipkontur.de> 2012-01-27 10:21:44 CET --- 101806 State:new By:seife When:2012-01-27T09:50:52 submit: home:seife:branches:Base:System/aaa_base -> Base:System Descr: fix alljava.sh bug introduced with last commit (bnc#722252) An additional "break" was added after the last comment to make sure it also works for the SDK_HOME / JDK_HOME *) - export JRE_HOME=3D$JPATH/jre + export JRE_HOME=$JPATH/jre # it is development kit if [ -x $JPATH/bin/javac ] ; then - export JDK_HOME=3D$JPATH - export SDK_HOME=3D$JPATH + export JDK_HOME=$JPATH + export SDK_HOME=$JPATH + break fi I'm not going to self-accept this SR since some review is certainly advised ;-) It did work for me building rxtx-java and arduino (which both failed before). The current state before this SR breaks java completely IMHO. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c15 --- Comment #15 from Bernhard Wiedemann <bwiedemann@suse.com> 2012-01-27 22:00:10 CET --- This is an autogenerated message for OBS integration: This bug (722252) was mentioned in https://build.opensuse.org/request/show/101864 Factory / aaa_base -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c16 Daniel Pecka <nettezzaumanaa@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P4 - Low |P3 - Medium --- Comment #16 from Daniel Pecka <nettezzaumanaa@gmail.com> 2012-02-22 03:48:36 UTC --- Hello Stefan, hello others I have originally started all this bug by discussing current state with martin vyskocil and martin then has created this bug. well, that script is simply bad. I didn't noticed that before here but i've spent the past 4 years of my life with deploying java based apps in enterprise on various UNIXes and my personal opinion raised from the field is that maintaining java on suse requires to be real inventive. the sun/oracle java is removed from software we care for (even from repo-non-oss) and we have only openjdk. the current scheme where we place a java instances to /usr/$libarch/jvm is not bad. Problem is, that we have hardcoded several paths where script looks for java and we absolutely don't count with anything ``out of the place''. Also in real life the most of sysadmins use some custom java for prod. there are two ways: 1) helper script setting up variables in alljava.sh (or in actual shell) based on user's choice made upon a collected list of available java versions (it accepts some optional paths from cli of course). in this scenario is alljava.sh not brought by the package but the `./alljava.sh.builder --opensuse-defaults' or something like that is executed during an installation of aaa_base. This script could be re-invoked on user request any time and could be brought by another package, etc ..... 2) if we want it all in alljava.sh, it musts be more inventive. It musts count with java from openSUSE vendor and also with custom paths and it musts select a correct version of available javas. **current pseudo-heuristic method where it brakes() just once it finds something is the worst solution** rewriting from scratch is the only way. 3) incorporate java to sysconfig ? << i personally vote for something like this Let me deal with that. Gimme some time (2-3 workin' days) and i supply the solution which we'd consider as the best. First, let's discuss about how it should be managed. I have proposed several ways. Current state is ridiculous and no patch will fix it without changing design. i would talk hours about my own visions on how should be dealt with java in suse. summary: - the break() *pseudo-heuristic as it is now must be changed to something smoother. - from solutions above the most instant and probably safe (or more likely workarounding) to this moment is #2 although it the less flexible. - i wote for either #1 or #3 after some serious discussion. regards, daniel -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c17 --- Comment #17 from Stefan Seyfried <seife@novell.slipkontur.de> 2012-02-22 09:54:17 CET --- Hi Daniel. I know almost nothing about java, so I cannot comment on your proposal. With the previous try at a fix I was just scratching my own itch as a packgager of rxtx-java and arduino. However, looking at the alljava.sh code I agree that "rewrite from scratch" sounds sane. Go for it. And as you are using it in a daily productive environment, your ideas clearly are more useful than mine could ever be in this area :-) All my humble opinion, of course. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c18 Daniel Pecka <nettezzaumanaa@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |NEEDINFO InfoProvider| |mvyskocil@suse.com --- Comment #18 from Daniel Pecka <nettezzaumanaa@gmail.com> 2012-02-22 09:10:17 UTC --- hello Martin V, i'm setting up a NEEDINFO with you as an info provider. Would you please read a comment #16 and state out what you think that's the best -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c19 --- Comment #19 from Daniel Pecka <nettezzaumanaa@gmail.com> 2012-02-22 10:12:12 UTC --- please note, that we still support etc/alternatives scheme so definitely the only default search path should be just etc/alternatives in the script as suse defaults - the real heuristic mechanism then is that it takes the highest openjdk version with openSUSE vendor found there.- it's the first mode - in the second mode the system administrator sets up those variables. ^^ it's clear and reasonable as example of scenario #2 from above. d -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c20 Michal Vyskocil <mvyskocil@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- InfoProvider|mvyskocil@suse.com |nettezzaumanaa@gmail.com --- Comment #20 from Michal Vyskocil <mvyskocil@suse.com> 2012-02-22 12:28:11 UTC --- Hallo Daniel, I did not notice I maintain Java for more years than yours poor 4 year experience, so it's evident I am right -> RESOLVED/FIXED no, I'm joking, but I really dislike such games I've added the option for /usr/java as it's a default path for Oracle Java. As we were enforced to remove it from distribution by Oracle (IOW this is **not** our fault, blaim Oracle instead), it can make live of openSUSE users easier, as they now have to install their Oracle Java on their own. I agree with you that some/most of sysadmins installs their own system java and they have to be able setup the JAVA_HOME et all like they want. However I don't see a reason why to do such overengineering as you propose. I would rather exclude the /usr/share/java(latest) from alljava.sh. I would propose opinion number 4 $ cat <<EOF >>/etc/profile.local export JAVA_HOME=/here/is/my/favourite/java unset JRE_HOME #and other stuff from alljava.sh EOF It is nice, it is simple, it is straightforward, it allows you to do everything you want to do, it exists (not only) in SUSE for ages, it's definitely not "inventive" as it is an old-good-simple-unix-way of configuring things. And it took you around 10 seconds to setup your system properly, so it is very very cheap. Or did I overlooked anything in your proposal can't be solved using /etc/profile.local? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c21 Daniel Pecka <nettezzaumanaa@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- InfoProvider|nettezzaumanaa@gmail.com |mvyskocil@suse.com --- Comment #21 from Daniel Pecka <nettezzaumanaa@gmail.com> 2012-02-24 12:46:14 UTC --- hello, well, after discussing this with Michal V. i suppose, that i could now remove needinfo. So the final proposal is: - determine distro based openjdk from etc/alternatives - caunt with oracle java located in /usr/java - we should get rid of that break and the script should work like that it finds a openjdk as noted above OR it prefers sun if installed - we should mind it in release notes - we should create a alljava.sh.custom template where will be by default commented out those vars and in case of user change they will be preffered. I suggest something like this at the end (or at the beggining skipping the alljava.sh execution): if [ `egrep -v ^#\|^$ alljava.sh.custom | wc -l` -ge 0 ]; then . alljava.sh.custom; fi regards, d -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c22 Daniel Pecka <nettezzaumanaa@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #454640|0 |1 is obsolete| | Attachment #455564|0 |1 is obsolete| | Attachment #455616|0 |1 is obsolete| | --- Comment #22 from Daniel Pecka <nettezzaumanaa@gmail.com> 2012-02-28 03:56:42 UTC --- Created an attachment (id=478247) --> (http://bugzilla.novell.com/attachment.cgi?id=478247) alljava.sh from scratch hello, this patch should cover all possible cases. It works, i tested it with all supported javas (openSUSE openjdk-*, oracle java se jre/jvm) for weeding out my comments just do: grep -v ^### alljava.sh.new regards, daniel -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c Michal Vyskocil <mvyskocil@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #478247|application/octet-stream |text/plain mime type| | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c23 Michal Vyskocil <mvyskocil@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- InfoProvider|mvyskocil@suse.com |nettezzaumanaa@gmail.com --- Comment #23 from Michal Vyskocil <mvyskocil@suse.com> 2012-02-28 11:03:01 UTC --- Hallo Daniel, thanks for your work, I like your approach. I have those comments to your code You don't need to distinguish the openjdk and third-party java in /etc/alternatives - by default if there is anything in /etc/alternatives/java_sdk, it will be used. In any case this should have the biggest priority - you mentioned it in all comments, but code behaves differently. The /etc/profile.d/alljava.sh.custom is pointless. You have /etc/profile.local intended exactly for the same job - overriding values in profile. does it sounds good for you? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c24 Daniel Pecka <nettezzaumanaa@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |REOPENED InfoProvider|nettezzaumanaa@gmail.com | --- Comment #24 from Daniel Pecka <nettezzaumanaa@gmail.com> 2012-02-28 12:12:08 UTC --- Created an attachment (id=478321) --> (http://bugzilla.novell.com/attachment.cgi?id=478321) alljava.sh upped hello Michal, problem is, that oracle java se jdk|jre leaves a etc/alternatives untouched .. i have very carefully investigated a rpm post/pre install scripts from oracle packages so if we want to make alljava.sh a aracle java se aware, we just have to hardcode those paths no matter that there could be whatever an admin places there under the name /usr/java .. these are how it works for all three cases:
env | egrep JAVA\|_HOME JRE_HOME=/usr/java/jdk1.7.0_03/jre JAVA_BINDIR=/usr/java/jdk1.7.0_03/bin JAVA_HOME=/usr/java/jdk1.7.0_03 SDK_HOME=/usr/java/jdk1.7.0_03 JDK_HOME=/usr/java/jdk1.7.0_03 JAVA_ROOT=/usr/java/jdk1.7.0_03
env | egrep JAVA\|_HOME JRE_HOME=/usr/lib64/jvm/java-1.6.0-openjdk-1.6.0/jre JAVA_BINDIR=/usr/lib64/jvm/java-1.6.0-openjdk-1.6.0/bin JAVA_HOME=/usr/lib64/jvm/java-1.6.0-openjdk-1.6.0 SDK_HOME=/usr/lib64/jvm/java-1.6.0-openjdk-1.6.0 JDK_HOME=/usr/lib64/jvm/java-1.6.0-openjdk-1.6.0 JAVA_ROOT=/usr/lib64/jvm/java-1.6.0-openjdk-1.6.0
env | egrep JAVA\|_HOME JRE_HOME=/usr/lib64/jvm/java-1.6.0-openjdk-1.6.0/jre JAVA_BINDIR=/usr/lib64/jvm/java-1.6.0-openjdk-1.6.0/jre/bin JAVA_HOME=/usr/lib64/jvm/java-1.6.0-openjdk-1.6.0/jre JAVA_ROOT=/usr/lib64/jvm/java-1.6.0-openjdk-1.6.0/jre
regards, d -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c Michal Vyskocil <mvyskocil@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #478321|application/octet-stream |text/plain mime type| | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c25 Michal Vyskocil <mvyskocil@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |NEEDINFO InfoProvider| |nettezzaumanaa@gmail.com --- Comment #25 from Michal Vyskocil <mvyskocil@suse.com> 2012-02-28 12:48:38 UTC --- (In reply to comment #24)
Created an attachment (id=478321) --> (http://bugzilla.novell.com/attachment.cgi?id=478321) [details] alljava.sh upped
hello Michal,
problem is, that oracle java se jdk|jre leaves a etc/alternatives untouched .. i have very carefully investigated a rpm post/pre install scripts from oracle packages so if we want to make alljava.sh a aracle java se aware, we just have to hardcode those paths no matter that there could be whatever an admin places there under the name /usr/java ..
Well, my POW is causing inconsistency /usr/bin/java != $JAVA_HOME/bin/java should be harder than just rpm -i random.rpm. IOW why would you need the vendor-java when you need the Oracle one? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c26 --- Comment #26 from Daniel Pecka <nettezzaumanaa@gmail.com> 2012-02-28 15:40:55 UTC --- okay, 1) /usr/bin/java doesn't exist .. JAVA_BINDIR is always inside JAVA_ROOT, if it's desired then just adding $JAVA_BINDIR to PATH is usual way. our openjdk won't be ever built with bindir|libdir outside the root tree. 2) someone would prefer to have both javas and oracle jre|jdk **doesn't obsolete any other java. Also removing openjdk is bit tricky because i have experienced many times that it sneaked in back after uninstalled while doing some obligatory update 3) **there's no other way** to add a oracle java SE support then just hardcoding those paths (/usr/java/latest). it's correct way and oracle java doesn't touch etc/alternatives. If the original goal is still valid (https://build.opensuse.org/request/show/101864), this fixes that. 4) also my script works in almost same way to current alljava.sh. Michal, i could change the prefered selection method order from sun-jdk-jre to jdk-jre-sun if you wish. regards, d -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c Daniel Pecka <nettezzaumanaa@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- InfoProvider|nettezzaumanaa@gmail.com |mvyskocil@suse.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c kk zhang <kkzhang@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kkzhang@novell.com AssignedTo|bnc-team-screening@forge.pr |mvyskocil@suse.com |ovo.novell.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c Xiyuan Liu <xyliu@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |xyliu@suse.com AssignedTo|bnc-team-screening@forge.pr |werner@suse.com |ovo.novell.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c29 --- Comment #29 from Xiyuan Liu <xyliu@suse.com> 2014-03-03 07:27:52 UTC --- Hi Werner, I' ve read all comments and I just suppose you as a right assignee. Since the email of Michal is disabled, I need to find a new bugowner for the two-year-old bug. Could you have a look at the issue? You may have some suggestion about it. Feel free to reassign. Thank you. ^^ -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c30 Dr. Werner Fink <werner@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bmaryniuk@suse.com, | |dmacvicar@suse.com, | |jrenner@suse.com, | |prusnak@opensuse.org, | |stefan.fent@suse.com AssignedTo|werner@suse.com |bnc-team-screening@forge.pr | |ovo.novell.com --- Comment #30 from Dr. Werner Fink <werner@suse.com> 2014-03-03 08:27:35 UTC --- Sorry but I do not have time to handle this bug -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c31 Daniel Pecka <nettezzaumanaa@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO InfoProvider| |xyliu@suse.com --- Comment #31 from Daniel Pecka <nettezzaumanaa@gmail.com> 2014-03-03 11:12:08 UTC --- @ Xi Yuan Liu why did you please reopen this bug ? Can you be please more descriptive about what's not working ? after looking into alljava.sh and checking my environment i tend to suppose, that you don't like that alljava.sh traverse to oracle java not using openjdk when both are installed, right ?
rpm -qa \*jdk\* jdk-1.7.0_51-fcs.x86_64 java-1_7_0-openjdk-1.7.0.6-24.13.5.x86_64 java-1_7_0-openjdk-headless-1.7.0.6-24.13.5.x86_64
set | grep JAVA JAVA_BINDIR=/usr/java/latest/bin JAVA_HOME=/usr/java/latest JAVA_ROOT=/usr/java/latest
and also please change product to 13.1 if you are not talking about 12.2. regards, daniel -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=722252 https://bugzilla.novell.com/show_bug.cgi?id=722252#c32 --- Comment #32 from Daniel Pecka <nettezzaumanaa@gmail.com> 2014-03-03 11:24:11 UTC --- btw, i investigated a little bit deeper .. current suse 13.1 alljava.sh makes java environment unconsistent because it sets both, openjdk and oracle java .. it uses oracle java before openjdk but exports JRE path along with oracle java
set | egrep JDK\|JRE\|JAVA JAVA_BINDIR=/usr/java/latest/bin JAVA_HOME=/usr/java/latest JAVA_ROOT=/usr/java/latest JDK_HOME=/usr/java/latest JRE_HOME=/usr/lib64/jvm/jre
my proposed alljava.sh seems working fine .. almost fine, it just for safe intentionally exports JRE_HOME along with JDK .. check line #27 regards, daniel -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com