need help on compatibility problem!

N

NeoGeoSNK

I receive an Exception when excute a jar that compiled from jdk
1.5.0_08:
"do not use gui.GUI.add(), use gui.GUI.getContentPane().add instead" on
jvm 1.4.2_08
However, i don't want to change the source code :). Is there sb can
give me some suggestion?
Thanks very much!
 
A

Andrew Thompson

NeoGeoSNK said:
I receive an Exception when excute a jar that compiled from jdk
1.5.0_08:
"do not use gui.GUI.add(), use gui.GUI.getContentPane().add instead" on
jvm 1.4.2_08
However, i don't want to change the source code :). Is there sb can
give me some suggestion?

Mark your project as 1.5+?

Andrew T.
 
A

Andrew Thompson

NeoGeoSNK said:
....
Hello Andrew Thompson,
what does "Mark" mean?

I.E. launch it using webstart, and in the JNLP..

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0" codebase="http://.." href="the.jnlp">
<information>
<title>Title</title>
<vendor>Vendor</vendor>
</information>
<resources>
<j2se
href="http://java.sun.com/products/autodl/j2se"
version="1.5+"/>
.....

Andrew T.
 
N

NeoGeoSNK

Andrew said:
I.E. launch it using webstart, and in the JNLP..

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0" codebase="http://.." href="the.jnlp">
<information>
<title>Title</title>
<vendor>Vendor</vendor>
</information>
<resources>
<j2se
href="http://java.sun.com/products/autodl/j2se"
version="1.5+"/>
....

Andrew T.
Hello Andrew T.
the program must access local files, if I launch it using webstart,
should i use JNLP API to accomplish this? so i also need to modify the
original source code? in addition ,how can i config the
"codebase="http://.." if the jnlp file is in current directory? the
only way i know is like: codebase="file:///D:\...", but it's a absolute
path,
^ ^"Thanks.
 
A

Andrew Thompson

NeoGeoSNK said:
...
the program must access local files, if I launch it using webstart,
should i use JNLP API to accomplish this?

A webstart application can access local files at least two ways.
1) unstrusted app. using the JLNP API FileService, but if you do
not want to alter the code, the other option is to ..
2) sign it, and request either all-permissions or
j2ee-client-application-premissions in the JNLP launch file.
..so i also need to modify the
original source code?

Option 1) yes, option 2) no.
..in addition ,how can i config the
"codebase="http://.." if the jnlp file is in current directory? the
only way i know is like: codebase="file:///D:\...", but it's a absolute
path,

A JNLP launch file can be tested this way..
Open a command prompt pointing to the directory of the
JNLP file, then type (something like)..

javaws -codebase file:. file:./thejnlp.jnlp

...that should load the WebStart manager, replacing the
codebase in 'thejnlp.jnlp' with the current directory.

(Note the codebase in the JNLP file can be a complete
lie, the launch file does not need to exist on the net, for
this to work)

HTH

Andrew T.
 
N

NeoGeoSNK

Andrew said:
A webstart application can access local files at least two ways.
1) unstrusted app. using the JLNP API FileService, but if you do
not want to alter the code, the other option is to ..
2) sign it, and request either all-permissions or
j2ee-client-application-premissions in the JNLP launch file.


Option 1) yes, option 2) no.


A JNLP launch file can be tested this way..
Open a command prompt pointing to the directory of the
JNLP file, then type (something like)..

javaws -codebase file:. file:./thejnlp.jnlp

..that should load the WebStart manager, replacing the
codebase in 'thejnlp.jnlp' with the current directory.

(Note the codebase in the JNLP file can be a complete
lie, the launch file does not need to exist on the net, for
this to work)

HTH

Andrew T.
Thanks a lot Andrew T
I'll select Option 2). ^ ^ i hope i can accomplish this problem
according to your help.
But I found i realy can't distinguish the "file:", "file:." , and
"file:///" :'(
I write a jnlp test file below and they are all ok
<jnlp codebase="file:." href="file:D:\c14\jnlp\filechooser.jnlp">
<jnlp codebase="file:" href="file:///D:\c14\jnlp\filechooser.jnlp">
<jnlp codebase="file:." href="file:\filechooser.jnlp">
<jnlp codebase="file:" href="file:\filechooser.jnlp">
 

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

Forum statistics

Threads
474,266
Messages
2,571,083
Members
48,773
Latest member
Kaybee

Latest Threads

Top