Skip to main content
1-Visitor
Dec 5, 2019 4:07 PM UTC
Question

Is a full Java Object-Toolkit installation needed on a client machine?

Dear community,

I wrote a OTK-Java-free application which runs fine on my developing environment. I am having problems to get the app working on client machines though.

One basic question: Is it possible to run this java-app without Java Object-Toolkit installation on the client machine? If so, how do I link to otk.jar?

I tried to link to the manually copied jar file in severals ways without success:

via config.pro option: jlink_java_command [path-to-folder]\java.exe -cp [path-to-folder]\otk.jar

via creotk.dat option: JAVA_APP_CLASSPATH [path-to-folder]\MyApp.jar;[path-to-folder]\otk.jar

 

I appreciate your help!

Best regards

Michael

11 replies

24-Ruby III
Dec 6, 2019 8:15 AM UTC

Hi,

you can test my uploaded example.

Once you unzip file, you have to modify protk.dat and Creo 5.0.2.0.bat.

Note: D:\Java\jdk64\jre\bin\java.exe ... java version "1.8.0_231"

 

Translate
MichelH1-VisitorAuthor
1-Visitor
Dec 6, 2019 11:46 AM UTC

Hello Martin,

thank you very much for your answer!

 

I did not test your example but I see how you link to otk.jar: by setting the classpath variable in the startup batch file. This should work, I believe! But I want to avoid altering the startup precedure on the client machines.

 

This is why I am trying to change the classpath either in the config.pro or the creotk.dat. I also tried a third option: linking to otk.jar inside my jar file via MANIFEST.MF

 

I just managed to get it running with setting the config.pro option to

jlink_java_command [path]\java.exe -cp [path]\otk.jar

 

This is second best, because inside config.pro I only want to link to the creotk.dat, e. g.

toolkit_registry_file [path]\creotk.dat

(I want to avoid that the user has to deal with internals like java classpaths).

So the best thing would be to set the classpath either in creotk.dat or the MANIFEST.MF file of my jar application.

 

Do you have any idea how to do so?

 

Best regards

Michael

Translate
24-Ruby III
Dec 6, 2019 12:56 PM UTC

@MichelH wrote:

Hello Martin,

thank you very much for your answer!

 

I did not test your example but I see how you link to otk.jar: by setting the classpath variable in the startup batch file. This should work, I believe! But I want to avoid altering the startup precedure on the client machines.

 

This is why I am trying to change the classpath either in the config.pro or the creotk.dat. I also tried a third option: linking to otk.jar inside my jar file via MANIFEST.MF

 

I just managed to get it running with setting the config.pro option to

jlink_java_command [path]\java.exe -cp [path]\otk.jar

 

This is second best, because inside config.pro I only want to link to the creotk.dat, e. g.

toolkit_registry_file [path]\creotk.dat

(I want to avoid that the user has to deal with internals like java classpaths).

So the best thing would be to set the classpath either in creotk.dat or the MANIFEST.MF file of my jar application.

 

Do you have any idea how to do so?

 

Best regards

Michael


Hi,
I asked Google ... protk.dat java_app_classpath site:ptc.com

In result list I found https://community.ptc.com/t5/Customization/JLink-adding-external-libraries-to-classpath/td-p/374767 discussion. It contains following information:

 

in the meantime I figured a rather strange looking syntax for the protk.dat by dividing two libs with a ".;"
java_app_classpath /apps/lib1.jar.;./apps/lib2.jar

 

So I removed CLASSPATH definition from Creo 5.0.2.0.bat and modified protk.dat (see attachment):

 

 

java_app_classpath D:\users\mh\creo5_parametric\PTC_JLink\install_test_05.;.E:\PTC\Creo5_020\Creo 5.0.2.0\Common Files\text\java\otk.jar

 

 

 

Translate