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

compiling java file in windchill shell won't take effect

SOLVED
Highlighted
Newbie

compiling java file in windchill shell won't take effect


As title, I typed a command like "javac xyz.java" in winchill shell, it showed no error,

the technical staff in retailer told me I should typed "windchill stop && windchill start" after that,

then the compiling took effect.

It really worked, but I could not do this in Office Hour, so please supplied me other ways to take effect immediately.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: compiling java file in windchill shell won't take effect

Andy,

The other comment I can make on this, is why is there a restart restriction? Are you developing directly on a production box?  Normally you would want a couple of Windchill environments available - test/dev, integration, production at a minimum.  If you had a dev box to work with the running of Windchill in debug.  I know this may sound obvious to most of the people in the group, but I am constantly amazed at how many customer do not have good setups for on going support of the deployment.

--Bob

View solution in original post

13 REPLIES 13
Highlighted

Re: compiling java file in windchill shell won't take effect

Andy,

The compiling actually does take effect right away.  The problem is that Windchill caches the executed code.  So the Windchill restart (and probably clearing caches) is a necessary step for newly-compiled code to execute.

You can test this.  For example, do a restart first, and execute javac before the code is executed.  You'll see the changes take effect immediately.  So the root of the problem is the cached executed code.

Highlighted

Re: compiling java file in windchill shell won't take effect

You can set Windchill in debug mode with eclipse, so you don’t need to restart Windchill every time after code change . However setting Windchill in debug mode is not useful/ recommended  for production environment.

You can configure eclipse with Windchill for development and file sync plugin. see below link for more details about configuring eclipse with Windchill 

https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS63697&art_lang=en&posno=2&q=eclipse_proje...

Hope it helps !!

Thanks

Shreyas

Highlighted

Re: compiling java file in windchill shell won't take effect

You could also use JRebel.  We use this on our sandboxes and one development box.  This will automatically redeploy new class files, and along with Tomcat in developer mode does most of what is necessary.  The only gotcha is to exclude PTC code from being reloaded by JRebel (done via an xconf setting).

Highlighted

Re: compiling java file in windchill shell won't take effect

Andy,

The other comment I can make on this, is why is there a restart restriction? Are you developing directly on a production box?  Normally you would want a couple of Windchill environments available - test/dev, integration, production at a minimum.  If you had a dev box to work with the running of Windchill in debug.  I know this may sound obvious to most of the people in the group, but I am constantly amazed at how many customer do not have good setups for on going support of the deployment.

--Bob

View solution in original post

Highlighted

Re: compiling java file in windchill shell won't take effect

Ben,

Thank you for your  prompt reply. Is there any way to clear caches instead of restarting ?


Highlighted

Re: compiling java file in windchill shell won't take effect

Bob,

Sorry, I'm not familiar with IT system construction, there are many concepts I must learn. Dose it work without restart windchill If I compile the java file into class file first in test/dev box, then copy class file to producntion box ?

Highlighted

Re: compiling java file in windchill shell won't take effect

Andy,

No worries - not everyone will agree with my opinions.  The point is, if you have a dev box you can start and stop it at will or run in debug mode while developing so that when your code moved to production you only have to stop the server once and you are reasonably sure the code will work.  Can I ask what exactly it is you are trying to do?  There may be other ways around your issue.

--Bob

Highlighted

Re: compiling java file in windchill shell won't take effect

Bob,

I just modify exist java file and recompile it into class file directly in production box and I know this action is not recommended.

All I want to do is make the change become effective without restart the production box.

I assume that compile the java file into class file first in test/dev box then copy class file to producntion box will take effect, I want to make sure that is true or not.

Re: compiling java file in windchill shell won't take effect

Compiling on a different system and then copying to production will still require a restart. The problem is that when a class is first loaded by the JVM, the definition of the class is stored in the PermGen memory region. As long as that class definition still exists in memory, Java won't recognize any changes to the class file on disk.

Announcements