deploying a java *.jar program ...

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

deploying a java *.jar program ...

Oliver Brinzing
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I was playing with a java program, that connects to a running office via remote connection ...

the program will be deployed as a *.jar file and it should be possible to start it double-clicking
on the jar file ... but this seems not to be possible cause I need the juh.jar,jurt.jar, juh.jar,...
files inside the class path ...

First I tried to use a windows *.lnk but the caller string is to long for all the class files :-(

So next I used a *.bat file to start the jar:

@setlocal
@set OOPath=D:\Programs\OpenOffice.org2.0\program\classes
@set
OOJars=%OOPath%\juh.jar;%OOPath%\jurt.jar;%OOPath%\jut.jar;%OOPath%\ridl.jar;%OOPath%\unoil.jar;%OOPath%\sandbox.jar
@start /B javaw -cp my_javaprogram.jar;%OOJars% org.test.Main
@endlocal

To avoid the pop up of the command window (for just a second) I created a windows *.url.
This is quite easy and the *.url file can be created during an install process, using java itself...

[InternetShortcut]
URL=file:///d:/programs/my_program/starter.bat
WorkingDirectory=d:\programs\my_program
IconFile=d:\programs\my_program\my_icon.ico
IconIndex=0
ShowCommand=7

Anyway, I also tried the to use a *.lnk using:

javaw.exe -Djava.ext.dirs="D:\Programs\OpenOffice.org2.0\program\classes" -jar
d:\programs\my_program\my_javaprogram.jar

But this does not work, cause my program uses jaxp and now takes the "xercesImpl.jar" from the OO
classpath instead of
the original java 1.5 class files ... this crashes my program with a

  java.lang.AbstractMethodError: org.apache.xerces.dom.

DeferredElementImpl.setUserData(Ljava/lang/String;Ljava/lang/Object;Lorg/w3c/dom/UserDataHandler;)Ljava/lang/Object;

As a workaround I could add an external standalone jaxp and use
"-Djava.endorsed.dirs=D:\java\jaxp1.3.endorsed",
but that's not what I really wanted to do ...

Any hints how to simplify this process ?
(I don't want to copy the oo *.jar files into my program folder, or even put them unpacked into my
programs *.jar file)

regards

Oliver

- --
GnuPG key 0xCFD04A45: 8822 057F 4956 46D3 352C 1A06 4E2C AB40 CFD0 4A45
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFDw/5CTiyrQM/QSkURAoW4AKCAJ+iOf8oF4aEQCTizFGxjQc1MwQCglpBe
K9HbX53KW+8MHsEzX9yjm8M=
=hB0H
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: deploying a java *.jar program ...

Juergen Schmidt-3
Hi Oliver,

it depends, if you would use the new simple bootstrap feature it should
work as expected with double clicking the jar file.

The new bootstrap feature search the default office on a computer and
starts a new instance if necessary. If an office instance is already
running it connects simply to the running office. The connection is
established over a named pipe. Your client application jar file needs a
special manifest entry and some glue code class files from the SDK.
For more details see the SDK examples and the DevGuide.

Juergen

Oliver Brinzing wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> I was playing with a java program, that connects to a running office via remote connection ...
>
> the program will be deployed as a *.jar file and it should be possible to start it double-clicking
> on the jar file ... but this seems not to be possible cause I need the juh.jar,jurt.jar, juh.jar,...
> files inside the class path ...
>
> First I tried to use a windows *.lnk but the caller string is to long for all the class files :-(
>
> So next I used a *.bat file to start the jar:
>
> @setlocal
> @set OOPath=D:\Programs\OpenOffice.org2.0\program\classes
> @set
> OOJars=%OOPath%\juh.jar;%OOPath%\jurt.jar;%OOPath%\jut.jar;%OOPath%\ridl.jar;%OOPath%\unoil.jar;%OOPath%\sandbox.jar
> @start /B javaw -cp my_javaprogram.jar;%OOJars% org.test.Main
> @endlocal
>
> To avoid the pop up of the command window (for just a second) I created a windows *.url.
> This is quite easy and the *.url file can be created during an install process, using java itself...
>
> [InternetShortcut]
> URL=file:///d:/programs/my_program/starter.bat
> WorkingDirectory=d:\programs\my_program
> IconFile=d:\programs\my_program\my_icon.ico
> IconIndex=0
> ShowCommand=7
>
> Anyway, I also tried the to use a *.lnk using:
>
> javaw.exe -Djava.ext.dirs="D:\Programs\OpenOffice.org2.0\program\classes" -jar
> d:\programs\my_program\my_javaprogram.jar
>
> But this does not work, cause my program uses jaxp and now takes the "xercesImpl.jar" from the OO
> classpath instead of
> the original java 1.5 class files ... this crashes my program with a
>
>   java.lang.AbstractMethodError: org.apache.xerces.dom.
>
> DeferredElementImpl.setUserData(Ljava/lang/String;Ljava/lang/Object;Lorg/w3c/dom/UserDataHandler;)Ljava/lang/Object;
>
> As a workaround I could add an external standalone jaxp and use
> "-Djava.endorsed.dirs=D:\java\jaxp1.3.endorsed",
> but that's not what I really wanted to do ...
>
> Any hints how to simplify this process ?
> (I don't want to copy the oo *.jar files into my program folder, or even put them unpacked into my
> programs *.jar file)
>
> regards
>
> Oliver
>
> - --
> GnuPG key 0xCFD04A45: 8822 057F 4956 46D3 352C 1A06 4E2C AB40 CFD0 4A45
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFDw/5CTiyrQM/QSkURAoW4AKCAJ+iOf8oF4aEQCTizFGxjQc1MwQCglpBe
> K9HbX53KW+8MHsEzX9yjm8M=
> =hB0H
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: deploying a java *.jar program ...

Matthias B.-2
In reply to this post by Oliver Brinzing
Hi Oliver

See DevGuide 3.4.1 Java Language Binding, subsection "SDK tooling". It
contains instructions on how to build a JAR that can be started with
the usual "java -jar jarfilename.jar" with no classpath-fiddling.

Ciao

Matthias

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: deploying a java *.jar program ...

Oliver Brinzing
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Am 11.01.2006 11:17 schrieb Matthias Benkmann:
> See DevGuide 3.4.1 Java Language Binding, subsection "SDK tooling". It
> contains instructions on how to build a JAR that can be started with
> the usual "java -jar jarfilename.jar" with no classpath-fiddling.

maybe I should start to read the new DevGuide :-)
seems that something has changed since oo 1.1.5 ...

last question: can this be used with oo 1.1.5 too ?

thanks

Oliver
- --

GnuPG key 0xCFD04A45: 8822 057F 4956 46D3 352C 1A06 4E2C AB40 CFD0 4A45
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFDxUDzTiyrQM/QSkURAqjpAKC1E8q83uYh1P10a7+3Drbo3RidkgCgkAA+
TGH87lQrysiB8PE8eEPoOok=
=8Hek
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: deploying a java *.jar program ...

Matthias B.-2
On 1/11/06, Oliver Brinzing <[hidden email]> wrote:
> last question: can this be used with oo 1.1.5 too ?

AFAIK it can't.

Matthias

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]