Re: Multiple Java versions
On 09/24/13 21:38, Jonathan Chen wrote: On 24 September 2013 22:36, Andrea Venturoli m...@netfence.it wrote: [...] Now, according to JAVAVMS(5), By default, javavm will select the most ``native'' and up to date version. However: % java -version openjdk version 1.6.0_32 OpenJDK Runtime Environment (build 1.6.0_32-b27) OpenJDK Server VM (build 20.0-b12, mixed mode) Any way to fix this? AFAICT I didn't set any relevant environment variable, anything in /etc/make.conf or in javavms' own config files. JAVA_HOME is what you need: jonathan:~,7:36am unsetenv JAVA_HOME jonathan:~,7:36am java -version openjdk version 1.6.0_32 OpenJDK Runtime Environment (build 1.6.0_32-b27) OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode) jonathan:~,7:36am setenv JAVA_HOME /usr/local/openjdk7 jonathan:~,7:36am java -version openjdk version 1.7.0_25 OpenJDK Runtime Environment (build 1.7.0_25-b15) OpenJDK 64-Bit Server VM (build 23.21-b01, mixed mode) Ok, fine for me. I'd just point out: isn't it in contrast to what the man page says (i.e. By default, javavm will select the most ``native'' and up to date version)? Should the docs be corrected then? bye Thanks av. ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: Multiple Java versions
On Tue, Sep 24, 2013 at 11:07 PM, Andrea Venturoli m...@netfence.it wrote: On 09/24/13 21:38, Jonathan Chen wrote: On 24 September 2013 22:36, Andrea Venturoli m...@netfence.it wrote: [...] Now, according to JAVAVMS(5), By default, javavm will select the most ``native'' and up to date version. However: % java -version openjdk version 1.6.0_32 OpenJDK Runtime Environment (build 1.6.0_32-b27) OpenJDK Server VM (build 20.0-b12, mixed mode) Any way to fix this? AFAICT I didn't set any relevant environment variable, anything in /etc/make.conf or in javavms' own config files. JAVA_HOME is what you need: jonathan:~,7:36am unsetenv JAVA_HOME jonathan:~,7:36am java -version openjdk version 1.6.0_32 OpenJDK Runtime Environment (build 1.6.0_32-b27) OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode) jonathan:~,7:36am setenv JAVA_HOME /usr/local/openjdk7 jonathan:~,7:36am java -version openjdk version 1.7.0_25 OpenJDK Runtime Environment (build 1.7.0_25-b15) OpenJDK 64-Bit Server VM (build 23.21-b01, mixed mode) Ok, fine for me. I'd just point out: isn't it in contrast to what the man page says (i.e. By default, javavm will select the most ``native'' and up to date version)? Should the docs be corrected then? bye Thanks av. The docs may need clarification, however you may want to look into using: java/javavmwrapper cc: java -jgh -- Jason Helfman | FreeBSD Committer j...@freebsd.org | http://people.freebsd.org/~jgh | The Power to Serve ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: Multiple Java versions
On 09/25/13 08:28, Jason Helfman wrote: java/javavmwrapper cc: java Sorry for being so dumb, but I don't understand this... I though I was using javavmwrapper... what do you mean? bye Thanks av. ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: Multiple Java versions
On 09/25/13 00:38, Andrea Venturoli wrote: On 09/25/13 08:28, Jason Helfman wrote: java/javavmwrapper cc: java Sorry for being so dumb, but I don't understand this... I though I was using javavmwrapper... what do you mean? I believe you are correct in your original statement, and that there is something wrong with the java startup script. You do not need to set JAVA_HOME. The startup script has code to locate all installed versions, set JAVA_HOME if not already set, prioritize them, and execute the latest one; but it doesn't seem to be working properly. There is no javavmwrapper, at least in my installation(s). The java startup script (/usr/local/bin/java) indicates it is itself javawrapper.sh. If JAVA_HOME is not set, the startup script finds a java by using make, and that finds openjdk6 when openjdk6 and openjdk7 are both installed. In this case, the script is not using the installed prioritization list in /usr/local/etc/javavms. It seems to me it should be checking this before resorting to what make finds. However, you can avoid this behavior and get the right thing by setting JAVAVM_FALLBACK_ONLY=1 gary ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: Multiple Java versions
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2013-09-25 14:54:13 -0400, Gary Aitken wrote: On 09/25/13 00:38, Andrea Venturoli wrote: On 09/25/13 08:28, Jason Helfman wrote: java/javavmwrapper cc: java Sorry for being so dumb, but I don't understand this... I though I was using javavmwrapper... what do you mean? I believe you are correct in your original statement, and that there is something wrong with the java startup script. You do not need to set JAVA_HOME. The startup script has code to locate all installed versions, set JAVA_HOME if not already set, prioritize them, and execute the latest one; but it doesn't seem to be working properly. There is no javavmwrapper, at least in my installation(s). The java startup script (/usr/local/bin/java) indicates it is itself javawrapper.sh. If JAVA_HOME is not set, the startup script finds a java by using make, and that finds openjdk6 when openjdk6 and openjdk7 are both installed. Because java/openjdk6 is the default Java for FreeBSD ATM. If you want to force openjdk7 for some reason, you just have to set JAVA_VERSION, e.g., % java -version openjdk version 1.6.0_32 OpenJDK Runtime Environment (build 1.6.0_32-b27) OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode) % env JAVA_VERSION=1.7 java -version openjdk version 1.7.0_25 OpenJDK Runtime Environment (build 1.7.0_25-b15) OpenJDK 64-Bit Server VM (build 23.21-b01, mixed mode) Please see javavm(1) for more information, i.e., man javavm. In this case, the script is not using the installed prioritization list in /usr/local/etc/javavms. It seems to me it should be checking this before resorting to what make finds. Please note /usr/local/etc/javavms is never ordered by user preference, *intentionally*. However, you can avoid this behavior and get the right thing by setting JAVAVM_FALLBACK_ONLY=1 It is normally unnecessary. Jung-uk Kim -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.21 (FreeBSD) iQEcBAEBAgAGBQJSQzQ/AAoJEHyflib82/FGEacH/iQh2YXQ5w/6OP+crwRK8xr7 jxckXVBog4CVfnF+RHjHKJ9ByYlVjBZCLzMeMLFSdPDfKS9K0vHPR6AQVOBPQhz0 Rakgzxw8ocoxXZcHwo0mWu7rNvJJJUt+QOjraeQcbGa5JhXgTwH5j1hVG3iPeVD7 YNaE1id9cp/RJ4sMLMJ99PQgDDWRky9WX/H+axNm/DfwouwcR2oAkYeeIA5WfsDF mQQYgiAf6oWQMPMqT94Ml/AhsA3UD8yQ+T6hJOeSqkWpSxtfCdkNi+6icndzshEz iIRkzY3IDf/Hb3nBX4oQz9J0Tj0PxL3P00ZBxJi8bYZavsd8C6caT4ZwPGngwYE= =d9xb -END PGP SIGNATURE- ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: Multiple Java versions
On 09/25/13 12:54, Gary Aitken wrote: On 09/25/13 00:38, Andrea Venturoli wrote: On 09/25/13 08:28, Jason Helfman wrote: java/javavmwrapper cc: java Sorry for being so dumb, but I don't understand this... I though I was using javavmwrapper... what do you mean? I believe you are correct in your original statement, and that there is something wrong with the java startup script. You do not need to set JAVA_HOME. The startup script has code to locate all installed versions, set JAVA_HOME if not already set, prioritize them, and execute the latest one; but it doesn't seem to be working properly. There is no javavmwrapper, at least in my installation(s). The java startup script (/usr/local/bin/java) indicates it is itself javawrapper.sh. If JAVA_HOME is not set, the startup script finds a java by using make, and that finds openjdk6 when openjdk6 and openjdk7 are both installed. In this case, the script is not using the installed prioritization list in /usr/local/etc/javavms. It seems to me it should be checking this before resorting to what make finds. However, you can avoid this behavior and get the right thing by setting JAVAVM_FALLBACK_ONLY=1 My mistake. It is operating as advertised, although I think it's crazy that bsd.java.mk should be choosing openjdk6 over openjdk7. But if what you want is the prioritization set in /usr/local/etc/javavms, then you want to set JAVAVM_FALLBACK_ONLY instead of JAVA_HOME ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: Multiple Java versions
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2013-09-25 15:08:16 -0400, Gary Aitken wrote: On 09/25/13 12:54, Gary Aitken wrote: On 09/25/13 00:38, Andrea Venturoli wrote: On 09/25/13 08:28, Jason Helfman wrote: java/javavmwrapper cc: java Sorry for being so dumb, but I don't understand this... I though I was using javavmwrapper... what do you mean? I believe you are correct in your original statement, and that there is something wrong with the java startup script. You do not need to set JAVA_HOME. The startup script has code to locate all installed versions, set JAVA_HOME if not already set, prioritize them, and execute the latest one; but it doesn't seem to be working properly. There is no javavmwrapper, at least in my installation(s). The java startup script (/usr/local/bin/java) indicates it is itself javawrapper.sh. If JAVA_HOME is not set, the startup script finds a java by using make, and that finds openjdk6 when openjdk6 and openjdk7 are both installed. In this case, the script is not using the installed prioritization list in /usr/local/etc/javavms. It seems to me it should be checking this before resorting to what make finds. However, you can avoid this behavior and get the right thing by setting JAVAVM_FALLBACK_ONLY=1 My mistake. It is operating as advertised, although I think it's crazy that bsd.java.mk should be choosing openjdk6 over openjdk7. But if what you want is the prioritization set in /usr/local/etc/javavms, No, it is NOT the place for preference as I said earlier. In fact, it has (almost) no user serviceable part in it. then you want to set JAVAVM_FALLBACK_ONLY instead of JAVA_HOME No, it seems JAVA_VERSION is what you want. Jung-uk Kim -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.21 (FreeBSD) iQEcBAEBAgAGBQJSQzZBAAoJEHyflib82/FGCNsH/1VrZUM4iPH9EzVEk+FBEZU/ BEdqDg1CWxYAKlOaGB3RY5Lt9WlkIUVU6ydkLLe8fdWrwTu8V8F24SEPClQ63cY6 7cibKdI38vKR4kvONXX4GHULJVVW9CB7gEXalGAlnF5msSS2gwGjw639MUxjRzNl 5y2j/WWXkx8uBSmBHlCK3Orwy5QS1zxLH/dqz9jG07i4LC0ne6PRnE7pikHf3DN6 6C+Wx/xm3fzrhJhP23sXwDMSdJxxPEDC4++jugiHe74QFJlGzCrZpScw5uBicJ4X hqHsTiwEFtAUd8Aw7kjxrkqof4e1935wYXxPjrldKOXcRig9FEeEkv2hrJPnWNQ= =6BEh -END PGP SIGNATURE- ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org
Re: Multiple Java versions
On 24 September 2013 22:36, Andrea Venturoli m...@netfence.it wrote: [...] Now, according to JAVAVMS(5), By default, javavm will select the most ``native'' and up to date version. However: % java -version openjdk version 1.6.0_32 OpenJDK Runtime Environment (build 1.6.0_32-b27) OpenJDK Server VM (build 20.0-b12, mixed mode) Any way to fix this? AFAICT I didn't set any relevant environment variable, anything in /etc/make.conf or in javavms' own config files. JAVA_HOME is what you need: jonathan:~,7:36am unsetenv JAVA_HOME jonathan:~,7:36am java -version openjdk version 1.6.0_32 OpenJDK Runtime Environment (build 1.6.0_32-b27) OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode) jonathan:~,7:36am setenv JAVA_HOME /usr/local/openjdk7 jonathan:~,7:36am java -version openjdk version 1.7.0_25 OpenJDK Runtime Environment (build 1.7.0_25-b15) OpenJDK 64-Bit Server VM (build 23.21-b01, mixed mode) -- Jonathan Chen j...@chen.org.nz ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org