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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Compile synchronous J-Link application without restarting Creo

Waschbibaer
1-Newbie

Compile synchronous J-Link application without restarting Creo

Dear PTC users,


maybe you have an idea how to solve my problem. I am going to develop a synchronous J-Link application in Creo Parametric (but version does not play a role in this case). I just want to compile my project, check if it works, i case of ocurring malfuctions recompile it, checking again, recompiling and so on. but i always have to restart Creo because the new compiled classes are not recognized while running Creo. I also tried to stop and/or unregister my plugin in aux application and restart/reregister it. i also tried to rename my plugin in creotk.dat.


Does anyone know a technique to avoid this?


In last time i always developed asynchronous apps. there you dont have this problem beacuse you can connect and disconnect to/from session each time.


8 REPLIES 8


Hi Mario -

I've been through this situation myself:

> I just want to compile my project, check if it works, i case of ocurring
> malfuctions recompile it, checking again, recompiling and so on. but i
> always have to restart Creo because the new compiled classes are not
> recognized while running Creo.

This is all perfectly reasonable, and I had the same problems. Here's
what you can do to resolve it:

1. Learn to attach the Java debugger to your JLink application.
Doing this has many benefits.

2. For simple changes, edit & recompile your JLink application
while the debugger is attached. Java will "hot swap" your
changes into the currently running code.

Hot swapping does not work if you add a new class or make "schema"
changes (new classes, methods or attributes) to your project. It
will really help you out with minor changes, though.

I wrote a conference presentation on this subject in 2010, but I can't
find that presentation now. I'll keep looking for it.

|+| M a r k |+|

Mark Stallard
Rapid Response Development
Business Application Services
Enterprise Services Information Technology
Global Business Services
Raytheon Company




(business)
339-645-6423
(cell)
617-331-5443



-



235 Presidential Way
Woburn, MA 01801-1060
www.raytheon.com

This message contains information that may be confidential and privileged.
Unless you are the addressee (or authorized to receive mail for the
addressee), you should not use, copy or disclose to anyone this message or
any information contained in this message. If you have received this message
in error, please so advise the sender by reply e-mail and delete this
message. Thank you for your cooperation.









bfrandsen
6-Contributor
(To:Waschbibaer)

Set this in your config.pro:
jlink_java_command java -Xnoagent -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

That will allow you to attach the debugger from your IDE. In Netbeans you find it under Debug > Attach debugger...
The dialog looks like this:
[cid:image001.png@01CEB9C4.F357A8E0]
It works in a similar way in Eclipse.

/Bjarne

works perfectly fine with netbeans. thanks for your quick response. i also found your presentation. You called it "How to Debug ProENGINEER Applications in Any Language" from PTC World Event 2010


Mario -

I'm glad this worked for you:

> works perfectly fine with netbeans.

I haven't used NetBeans in a long time, but my guess is that NetBeans
actually TELLS you when it has performed a Java HotSwap update through
debugger. That's how I discovered HotSwap - by accident; when I re-
compiled while debugging in a commercial IDE named IntelliJ. As you
already stated, you can't stop and re-load JLink applications in Creo,
so hot-swap updates are incredibly helpful. I still think the concept
itself is incredible, too.

I receive no such notices from Eclipse. It seems to assume that I know
when the code was compiled and hot-swapped. Maybe I'm missing a plug-in.

> i also found your presentation. You called it "How to Debug ProENGINEER
> Applications in Any Language" from PTC World Event 2010

I'm glad you did. I found it eventually, with help from Patrick Williams,
and also after searching through backup drives.

I still believe that the debugger is the most valuable function in any
IDE like NetBeans. I was once one of those programmers who insisted on
makefiles and hated Visual Studio. My attitude changed after the first
time I debugged code in Visual Studio 6 and saw it automatically display
my local variables.

Anybody who's writing Creo applications really should learn to use a
debugger, especially because it takes so long to set up and re-test
after a run-time failure. It will save you hours of tedious work.

|+| M a r k |+|

Mark Stallard
Rapid Response Development
Business Application Services
Enterprise Services Information Technology
Global Business Services
Raytheon Company




(business)
339-645-6423
(cell)
617-331-5443



-



235 Presidential Way
Woburn, MA 01801-1060
www.raytheon.com

This message contains information that may be confidential and privileged.
Unless you are the addressee (or authorized to receive mail for the
addressee), you should not use, copy or disclose to anyone this message or
any information contained in this message. If you have received this message
in error, please so advise the sender by reply e-mail and delete this
message. Thank you for your cooperation.









Hi Mark,

 

Can you shared presentation for how to debug JLink with Eclipse IDE.

Nikhil_KPIT
4-Participant
(To:HamsterNL)

Hi HamsterNL,

 

I am facing issue for Connection Refuse of VM.

 

Here I attached snap of configuration setting of  Cronfig.Pro,Protk.Dat ,Remote VM and Error Snap.

 

Please help and needfull.

I have same problem too.
Top Tags