[icedtea-web] RFC: fix lookup of about.jnlp
Dr Andrew John Hughes
ahughes at redhat.com
Wed Feb 23 05:48:34 PST 2011
On 14:13 Tue 22 Feb , Omair Majid wrote:
> Hi,
>
> The fix to isolate icedtea-web in a non-JDK directory has resulted in
> javaws -about being broken. This is because javaws still looks for
> about.jnlp in the JDK directory. The attached patch fixes it by making
> netx use the about.jnlp that's included in netx.jar.
>
> I am not sure if this is the best fix; IcedTea-Web installs a separate
> about.jnlp in $(datadir)/icedtea-web/ which should be used instead.
>
> Ok to commit?
>
> Cheers,
> Omair
I don't think this is the right thing to do. The installed about.jnlp in $(datadir)
should be used.
> diff -r 87d12ebb7047 netx/net/sourceforge/jnlp/resources/Messages.properties
> --- a/netx/net/sourceforge/jnlp/resources/Messages.properties Tue Feb 22 12:59:18 2011 -0500
> +++ b/netx/net/sourceforge/jnlp/resources/Messages.properties Tue Feb 22 14:04:28 2011 -0500
> @@ -121,6 +121,7 @@
> # Runtime
> BLaunchAbout=Launching about window...
> BNeedsFile=Must specify a .jnlp file
> +RNoAboutJnlp=Unable to find about.jnlp
> BFileLoc=JNLP file location
> BArgNA=Arguments not used for this type of JNLP file (ignored).
> BParamNA=Parameters not used for this type of JNLP file (ignored).
> diff -r 87d12ebb7047 netx/net/sourceforge/jnlp/runtime/Boot.java
> --- a/netx/net/sourceforge/jnlp/runtime/Boot.java Tue Feb 22 12:59:18 2011 -0500
> +++ b/netx/net/sourceforge/jnlp/runtime/Boot.java Tue Feb 22 14:04:28 2011 -0500
> @@ -109,10 +109,6 @@
> + " -Xclearcache " + R("BXclearcache") + "\n"
> + " -help " + R("BOHelp") + "\n";
>
> - /** the JNLP file to open to display the network-based about window */
> - private static final String NETX_ABOUT_FILE = System.getProperty("java.home") + File.separator + "lib"
> - + File.separator + "about.jnlp";
> -
> private static final String doubleArgs = "-basedir -jnlp -arg -param -property -update";
>
> private static String args[]; // avoid the hot potato
> @@ -213,15 +209,19 @@
> }
>
> /**
> - * Returns the about.jnlp file in {java.home}/lib or null if this file
> + * Returns the location of the about.jnlp file or null if this file
> * does not exist.
> */
> private static String getAboutFile() {
> -
> - if (new File(NETX_ABOUT_FILE).exists())
> - return NETX_ABOUT_FILE;
> - else
> + ClassLoader cl = Boot.class.getClassLoader();
> + if (cl == null) {
> + cl = ClassLoader.getSystemClassLoader();
> + }
> + try {
> + return cl.getResource("net/sourceforge/jnlp/resources/about.jnlp").toString();
> + } catch (Exception e) {
> return null;
> + }
> }
>
> /**
> @@ -236,7 +236,7 @@
> if (getOption("-about") != null) {
> location = getAboutFile();
> if (location == null)
> - fatalError("Unable to find about.jnlp in {java.home}/lib/");
> + fatalError(R("RNoAboutJnlp"));
> } else {
> location = getJNLPFile();
> }
--
Andrew :)
Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)
Support Free Java!
Contribute to GNU Classpath and IcedTea
http://www.gnu.org/software/classpath
http://icedtea.classpath.org
PGP Key: F5862A37 (https://keys.indymedia.org/)
Fingerprint = EA30 D855 D50F 90CD F54D 0698 0713 C3ED F586 2A37
More information about the distro-pkg-dev
mailing list