IE opening .jnlp file - JRE version problem

B

Bojan

Hi,

When I try to open a .jnlp file from IE I get an error:
Java Web Start - Download Error

Under details it tells me that I need to download JRE 1.5+
But when I go to Tools -> Internet Options -> Advanced
I see that the JRE version is 1.5.

Parts of the jnlp file:

<jnlp spec="1.0+"
codebase="http://localhost:8080/"
<resources>
<j2se version="1.5+" max-heap-size="450M"/>
</resources>

The Java Web Start version is 1.2 (when it tried to open .jnlp file it
opens a window and sais Java Web Start v 1.2)


Any idea why this error occurs or how to solve it?

Any help is appreciated

Thanks in advance
 
J

Jeffrey H. Coffield

Bojan said:
Hi,

When I try to open a .jnlp file from IE I get an error:
Java Web Start - Download Error

Under details it tells me that I need to download JRE 1.5+
But when I go to Tools -> Internet Options -> Advanced
I see that the JRE version is 1.5.

Parts of the jnlp file:

<jnlp spec="1.0+"
codebase="http://localhost:8080/"

<resources>
<j2se version="1.5+" max-heap-size="450M"/>
</resources>

The Java Web Start version is 1.2 (when it tried to open .jnlp file it
opens a window and sais Java Web Start v 1.2)


Any idea why this error occurs or how to solve it?

Any help is appreciated

Thanks in advance

Perhaps this will help. Quoted from

http://java.sun.com/j2se/1.4.2/docs/guide/jws/developersguide/syntax.html

"If a platform version is specified (i.e., no href attribute is
provided), Java Web Start will not consider an installed non-FCS (i.e.,
milestone) JRE as a match. E.g., a request of the form

<j2se version="1.4+">

would not consider an installed 1.4.1-ea or 1.4.2-beta JRE as a match
for the request. Starting with 1.3.0, a JRE from Sun Microsystems, Inc.,
is by convention a non-FCS (milestone) JRE if there is a dash (-) in the
version string."

Jeff Coffield
www.digitalsynergyinc.com
 
B

Bojan

"If a platform version is specified (i.e., no href attribute is
provided),

<resources>
<j2se version="1.5+" max-heap-size="450M"/>
<jar href="/myJarFile.jar"/>
</resources>

Does this count as an href being provided or no?
 
J

Jeffrey H. Coffield

Bojan said:
<resources>
<j2se version="1.5+" max-heap-size="450M"/>
<jar href="/myJarFile.jar"/>
</resources>

Does this count as an href being provided or no?

I think the problem could be the version of Java installed is non-FCS
meaning it has a dash in it. What exactly does "java -version" show?

Jeff
 
B

Bojan

I think the problem could be the version of Java installed is non-FCS
meaning it has a dash in it. What exactly does "java -version" show?

java version 1.5
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)

I know that I can solve this by installing the new JRE version 1.6.
Is there any way I can solve it by changing some settings in the jnlp
file?

Bojan
 
J

Jeffrey H. Coffield

Bojan said:
java version 1.5
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)

I know that I can solve this by installing the new JRE version 1.6.
Is there any way I can solve it by changing some settings in the jnlp
file?

Bojan

Java 1.5.0-b64 contains a dash so it won't be used.

Try changing the version="1.5+" to version="1.5.0-b64" in the j2se resource.

Jeff
 
J

John B. Matthews

"Jeffrey H. Coffield said:
Java 1.5.0-b64 contains a dash so it won't be used.

Try changing the version="1.5+" to version="1.5.0-b64" in the j2se resource.

I am puzzled by this. I have two hyphenated versions:

$ java -version
java version "1.5.0_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)
Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)

$ java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06-153)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_07-b06-57, mixed mode)

But this works fine with either:

<j2se version="1.5+" href="http://java.sun.com/products/autodl/j2se"/>

As used here:

<http://robotchase.sourceforge.net/RobotChase.jnlp>
 
L

Lew

I don't believe you. Where's the "_nn" part?

Next time, copy and paste, don't paraphrase. Now once again, what *exactly*
does "java -version" show?
Java 1.5.0-b64 contains a dash so it won't be used.

Try changing the version="1.5+" to version="1.5.0-b64" in the j2se resource.

I have
$ java -version
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02, mixed mode)

This is definitely not a milestone release. I think you misrepresent the
"-bnn" suffix.

I get similar output with Java 1.5.0_13, a "-b05" and definitely not a
milestone release.
 
R

Roedy Green

<jnlp spec="1.0+"
codebase="http://localhost:8080/"

that is a peculiar thing to do, probably an error. That is what you
might do for debugging, to run from a local copy of the jar, not from
one on the web. I would ask the author "WTF?".

To check if your machine is set up for Java Web Start try one of these
apps:

http://mindprod.com/webstart/setclock.html
http://mindprod.com/webstart/replicator.html
http://mindprod.com/webstart/esper.html
--
Roedy Green Canadian Mind Products
http://mindprod.com

Now for something completely different:
 
R

Roedy Green

I have
$ java -version
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02, mixed mode)

that is the latest official version. It is not a beta.

I think this bit of code to take apart java version numbers might help
you understand how they work.

/*
* @(#)VersionCheck.java
*
* Summary: Check that Java version is sufficiently recent
*
* Copyright: (c) 1997-2009 Roedy Green, Canadian Mind Products,
http://mindprod.com
*
* Licence: This software may be copied and used freely for any
purpose but military.
* see http://mindprod.com/contact/nonmil.html
*
* Created with: IntelliJ IDEA IDE.
*
* Version History:
* 1.0 1997-03-23 - initial.
* 1.1 1998-11-10 - add dates
* 1.2 1998-12-14 - add isJavaVersionOK
* 1.3 1999-08-24 - add leftPad, rightPad, smarter rep.
isJavaVersionOK now handles 1.3beta.
* 1.4 2002-08-17 - add quoteSQL
* 1.5 2005-07-14 - split off from Misc, allow for compilation with
old compiler.
* 1.7 2006-03-04 - reformat with IntelliJ, provide Javadoc
*/

package com.mindprod.common11;

import java.awt.Color;
import java.awt.Container;
import java.awt.TextArea;

/**
* Check that Java version is sufficiently recent
*
* @author Roedy Green, Canadian Mind Products
* @version 1.7 2006-03-04 -
*
*/

public final class VersionCheck
{
// ------------------------------ FIELDS
------------------------------

/**
* true if you want extra debugging output and test code
*/
static final boolean DEBUGGING = false;
// -------------------------- PUBLIC STATIC METHODS
--------------------------

/**
* Ensures Java runtime version e.g. 1.1.7 is sufficiently recent.
Based on code by Dr. Tony Dahlman
* <[email protected]>
*
* @param wantedMajor java major version e.g. 1
* @param wantedMinor Java minor version e.g. 1
* @param wantedBugFix Java bugfix version e.g. 7
*
* @return true if JVM version running is equal to or more recent
than (higher than) the level specified.
*/
public static boolean isJavaVersionOK( int wantedMajor,
int wantedMinor,
int wantedBugFix )
{
try
{
try
{
// java.version will have form 1.1.7A, 11, 1.1., 1.1,
1.3beta,
// 1.4.2_05 or 1.4.1-rc
// It may be gibberish. It may be undefined.
// We have do deal with all this malformed garbage.
// Because incompetents run the world,
// it is not nicely formatted for us in three fields.
String ver = System.getProperty( "java.version" );

if ( ver == null )
{
return false;
}

ver = ver.trim();

if ( ver.length() < 2 )
{
return false;
}

int dex = ver.indexOf( '.' );

if ( dex < 0 )
{
// provide missing dot
ver = ver.charAt( 0 ) + '.' + ver.substring( 1 );
dex = 1;
}

int gotMajor = Integer.parseInt( ver.substring( 0, dex
) );
if ( DEBUGGING )
{
System.out.println( "major:" + gotMajor );
}
if ( gotMajor < wantedMajor )
{
return false;
}
if ( gotMajor > wantedMajor )
{
return true;
}

// chop off major and first dot.
ver = ver.substring( dex + 1 );

// chop trailing "beta"
if ( ver.endsWith( "beta" ) )
{
ver = ver.substring( 0, ver.length() -
"beta".length() );
}
// chop trailing "-rc"
if ( ver.endsWith( "-rc" ) )
{
ver = ver.substring( 0, ver.length() -
"-rc".length() );
}
// chop any trailing _nn
dex = ver.lastIndexOf( '_' );
if ( dex >= 0 )
{
ver = ver.substring( 0, dex );
}
// chop any trailing letter as in 1.1.7A,
// but convert 1.1.x or 1.1.X to 1.1.9
char ch = ver.charAt( ver.length() - 1 );
if ( !Character.isDigit( ch ) )
{
ver = ver.substring( 0, ver.length() - 1 );
if ( ch == 'x' || ch == 'X' )
{
ver += '9';
}
}
// check minor version
dex = ver.indexOf( '.' );
if ( dex < 0 )
{
// provide missing BugFix number as in 1.2 or 1.0
ver += ".0";
dex = ver.indexOf( '.' );
}

int gotMinor = Integer.parseInt( ver.substring( 0, dex
) );
if ( DEBUGGING )
{
System.out.println( "minor:" + gotMinor );
}
if ( gotMinor < wantedMinor )
{
return false;
}
if ( gotMinor > wantedMinor )
{
return true;
}
// was equal, need to examine third field.
// check bugfix version
ver = ver.substring( dex + 1 );
int gotBugFix = Integer.parseInt( ver );
if ( DEBUGGING )
{
System.out.println( "bugFix:" + gotBugFix );
}
return ( gotBugFix >= wantedBugFix );
}
catch ( NumberFormatException e )
{
if ( DEBUGGING )
{
System.out.println( "number format" +
e.getMessage() );
}
return false;
}// end catch
}
catch ( StringIndexOutOfBoundsException e )
{
if ( DEBUGGING )
{
System.out.println( "out of bounds:" + e.getMessage()
);
}

return false;
}// end catch
}// end isJavaVersionOK

/**
* use in a paint routine if Java version is not ok, usually
tested statically.
*
* @param wantedMajor java major version e.g. 1
* @param wantedMinor Java minor version e.g. 1
* @param wantedBugFix Java bugfix version e.g. 7
* @param container container to add an error message
component.
*
* @return true if version is ok
*/
public static boolean isJavaVersionOK( int wantedMajor,
int wantedMinor,
int wantedBugFix,
Container container )
{
if ( isJavaVersionOK( wantedMajor, wantedMinor, wantedBugFix )
)
{
return true;
}
else
{
String error =
"Error: You need Java "
+ wantedMajor
+ "."
+ wantedMinor
+ "."
+ wantedBugFix
+ " or later to run this Applet.\n"
+ "You are currently running under Java "
+ System.getProperty( "java.version" )
+ ".\n"
+ "Get the latest Java from
http://java.com/en/index.jsp";
TextArea complain =
new TextArea( error, 3, 42,
TextArea.SCROLLBARS_NONE );

complain.setEditable( false );
complain.setBackground( Color.white );
complain.setForeground( Color.red );
complain.setSize( 300, 50 );
container.setLayout( null );
container.add( complain );
System.err.println( error );
return false;
}
}

// --------------------------- CONSTRUCTORS
---------------------------

/**
* VersionCheck contains only static methods.
*/
private VersionCheck()
{

}
}
--
Roedy Green Canadian Mind Products
http://mindprod.com

Now for something completely different:
 
R

Roedy Green

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top