cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Configuring J-Link in Creo 2.0

KOENVERSCHOOTEN
1-Visitor

Configuring J-Link in Creo 2.0

Hello everyone,

 

We are currently in the process of evaluating Creo 2.0

One problem that we can not seem to solve is configuring our J-Link application (which runs succesfully in WildFire 5.0) in Creo 2.0

There seems to be something wrong and I hope someone on this forum already has experience with J-Link in Creo 2.0

 

This is the current configuration which works in WildFire 5.0

  • C:\Projects\Shape\Shape.jar is the JAR file to be used by J-Link
  • C:\Projects\Shape\Text\shape.txt is the text file used in the application
  • Environment Variable "CLASSPATH = C:\Projects\Shape\Shape.jar"
  • Protk.dat file located in C:\ptc\proeWildfire 5.0\text

name Shape

startup java

java_app_class Shape

java_app_start start

java_app_stop stop

allow_stop true

delay_start false

text_dir C:\Projects\Shape\text\

revision 0.0

end

 

This is the configuration which does not work in Creo 2.0

  • C:\Projects\Shape\Shape.jar is the JAR file to be used by J-Link
  • C:\Projects\Shape\Text\shape.txt is the text file used in the application
  • Environment Variable "CLASSPATH = C:\Projects\Shape\Shape.jar"
  • Protk.dat file located in C:\ptc\Creo 2.0\Common Files\F001\text

name Shape

startup java

java_app_class Shape

java_app_start start

java_app_stop stop

allow_stop true

delay_start false

text_dir C:\Projects\Shape\text\

revision 0.0

end

 

As you can see, the only difference is that we copied the WildFire 5.0 'Protk.dat' file to C:\ptc\Creo 2.0\Common Files\F001\text

 

If someone has anything to add, please do.

 

Kind regards...


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
ACCEPTED SOLUTION

Accepted Solutions

Hi Koen...

Did you try the J-Link Install Test application I referenced in the above thread? If the test application doesn't work, maybe you have an issue with the JRE. If it does work, then it sounds like you have an issue with your specific setup.

If the test works, I'd steal one of PTC's protk.dat files and modify it to point to your classpath and text_dir. Let us know what the results are.

In your listing above, your text file is in the directory ...\Text while your "text_dir" is pointing to ...\text (lowercase "t"). I know this shouldn't matter but at this point anything is worth a try.

Thanks!

-Brian

View solution in original post

17 REPLIES 17

Koen -

I am having the same problem here with my J-Link programs, they work fine in WF5, but fail everytime in Creo 1 and 2 - have you had any success with yours yet?

Thanks,

Josh

Hi Josh and Koen...

Have you both made sure to add the pfc.jar archive into your CLASSPATH? From what I recall, you're supposed to have your own classes in CLASSPATH but you're also supposed to keep the default pfc.jar as well. Not sure if this will help, but it's worth a try.

Also, the J-Link documentation specifically says you need to be using the java_app_classpath field in the registry file. I didn't see this in Koen's listing. I'm not sure if this is a new requirement or not but it could be important. Upon further investigation, I don't even see PTC using this field in their own .dat files so maybe it's not relevant.

One final note... have either of you tried the J-Link Install Test application? Look at pg 420 in the Creo 2.0 J-Link User's Guide. If you look in the <loadpoint>PTC/Creo 2.0/Common Files/F001/jlink/jlink_appls directory and dig around in some of the subdirectories there, you'll find a good number of protk.dat files. I noticed one minor thing by checking these out...

In Koen's listing for text_dir he shows "C:\Projects\Shape\text\" but all of the PTC files would not have the trailing "\" on the directory. PTC shows no trailing "\" so maybe try that text_dir setting as "C:\Projects\Shape\text" instead??

One final idea... maybe the protk.dat file isn't being read correctly. Can you load the applications manually and get them to work? It's possible to manually point to the protk.dat file for instances where you don't want the application to load upon startup. Are you able to load your J-Link application after Creo is running? If so, maybe you need to add a line to your config.pro to reference the location of the protk.dat file. I can't find any documentation that says the location of the file should be moved... but now that we're using the new "Common Files" location, maybe the protk.dat files need to go someplace else? If so, you can always point to them using the config.pro option protkdat. There's also some notation about a new option labeled creotkdat but I couldn't find much on it.

I know that's a scattered bit of advice but maybe something in there will be helpful!

Thanks... and good luck. Please write back and let us know if we've made progress or if none of these suggestions worked.

-Brian

Brian -

Thanks for the suggestions - these are all excellent ideas to try, but I have already tried them and unfortunately none seem to yeild any better success. I am able to load the protk.dat file into session (mine does include the java_app_classpath line and does not have trailing '\' on any path) both manually and through the config.pro file, but when I try to start the program I get a 'Program Failed to Start' message.

I have also tried editing the code to remove the functions that placed the program command in a menu since this is no longer supported, and I recompiled it with the new j-link classes in the most recent (M010) release. None of this has had any effect.

For reference, in WF5 we run the programs from a network location, calling the protk.dat file from our standard config.pro file and the java_app_classpath line makes it possible to run the program without having to add the CLASSPATH variable to every user's computer (not that that is hard to do, but it shouldn't be necessary).

Well, I will keep plugging away at it and hopefully a solution will present itself sometime soon...

Thanks,

Josh

I feel like I've said the same thing to 2 other people today... but this really sounds more like a bug than anything else. Have you opened a ticket with customer support? Maybe if they could SEE the problem and test it with WF5 and then again on Creo1&2, they could figure out what's happening. You've tried everything I would try... and more!

I hope you find a way through this soon. Sorry I wasn't more help. Please keep us poste don your progress.

Best regards,

-Brian

Brian, Koen -

It seems a little odd since I swear I had already tried changing this, but the issue I was having seems to be that my CLASSPATH variable was pointing to the WF5 pfc.jar file. Also I re-installed Creo to be sure I installed the included JRE (it is not installed by default), but with the classpath fixed it works with all the other JRE versions I have installed. I did make some other (unfortunately hasty as I don't recall everything I changed) changes to the PATH variable, but I don't believe those were the fix in this case. So my current setup which is now working:

  • Original code that was working in WF5
  • No CLASSPATH variable (or CLASSPATH pointed to the Creo 2 pfc.jar and pfcasync.jar files)
    • JAVA_APP_CLASSPATH line in the protk.dat files points to the custom classes
  • Works with JRE6u13 (installed with Creo, started by default unless specified), also tested with JRE6u24 and JRE7u05 using the jlink_java_command config.pro option

I will try these apps again tomorrow on another computer and see if I can reproduce the issues or results. I will post again if anything else turns up.

Thanks,

Josh

No matter what the underlying issue... you can't argue with success! Glad you're back to workin again!

Hello again,

Many thanks for the helpful answers, but we are no step closer to finding the correct setup.

I have been in contact with PTC, but to no avail.

This is our setup at the moment, which does not work in Creo 2.0 M010 (we upgraded to the latest version as well)

  • C:\Projects\Shape\Shape.jar is the JAR file to be used by J-Link
  • C:\Projects\Shape\Text\shape.txt is the text file used in the application
  • No Environment Variable "CLASSPATH"
  • Protk.dat file located in C:\ptc\Creo 2.0\Common Files\M010\text

name Shape

startup java

java_app_class Shape

java_app_classpath C:\Projects\Shape\Shape.jar

java_app_start start

java_app_stop stop

allow_stop true

delay_start false

text_dir C:\Projects\Shape\text

revision 0.0

end

Brian, Josh,

See anything wrong with this setup?

have you tried using the config.pro option 'jlink_java_command' pointed to the java.exe file in your JRE installation?

for example, mine is:

jlink_java_command C:\program files\java\jre7\bin\java.exe

I noticed the JRE included with Creo does not install by default, you may have missed it in the new installer.

- Josh

Hi Koen...

Did you try the J-Link Install Test application I referenced in the above thread? If the test application doesn't work, maybe you have an issue with the JRE. If it does work, then it sounds like you have an issue with your specific setup.

If the test works, I'd steal one of PTC's protk.dat files and modify it to point to your classpath and text_dir. Let us know what the results are.

In your listing above, your text file is in the directory ...\Text while your "text_dir" is pointing to ...\text (lowercase "t"). I know this shouldn't matter but at this point anything is worth a try.

Thanks!

-Brian

Well I finally got the application working.

Like Brian suggested, there seemed to be something wrong with my JRE installation.

I removed Creo 2.0, JRE 6, JRE 7 and my JDK installation.

I ran JavaRa (to clean all my previous JRE installations) and CCleaner (to clean all registry settings related to Java and Creo).

I reinstalled Creo 2.0 WITH JRE and now I can manually load the protk.dat file and the application runs fine...

Still need to install JRE and JDK for development, but atleast this is working...

Thanks for the help everyone!!

Congratulations Koen! I'm glad you got it working!

各位大师,你们好,我在安装CREO2.0时,按照正确的步骤来安装,可是,启动时,系统总是发出警告说需要CREOSIM_SSQ. 请问,那是什么呀?

Too day I'm unsuccessfully trying to run on StartInstallTest jlink in Creo 2 M10,
I get a message in the trail file and dilog:

Message Dialog: Warning Startup of application "InstallTest" failed.

I try different jre, CLASSPATH and set CREO with the standard jre that does not help.


Maybe somebody knows how to turn on DEBUG log CREO to understand the cause of this error.

Or post working configuration.

You probably have to add the location of the custom classes to your classpath (or use other methods of pointing Creo to the custom classes). I compiled the code and changed the included protk.dat file as shown below and it started (this is the method I use to locate the custom classes, there are others). Once it starts you can't do anything with it because the code is obsolete for the new ribbon interface - the command is not designated to be added to the ribbon. Read the user guide to learn more about that.

protk.dat:

name InstallTest

startup java

java_app_class StartInstallTest

java_app_classpath C:\Program Files\PTC\Creo 2.0\Common Files\M010\jlink\jlink_appls\install_test

java_app_start start

java_app_stop stop

allow_stop true

delay_start false

text_dir C:\Program Files\PTC\Creo 2.0\Common Files\M010\jlink\jlink_appls\install_test\text

end

Thanks, problem solved, for fine work jlink in Creo 2 need set jre path in config.pro file.

@ Brian J-Link Install Test application. Please help i can't find it I am using Creo2.0

...\Creo 2.0\Common Files\M090\jlink\jlink_appls\install_test

Announcements


Top Tags