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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Setting up Eclipse or Netbeans WindchillDev. Environment

sdrzewiczewski
7-Bedrock

Setting up Eclipse or Netbeans WindchillDev. Environment

I just did the zip of wt and com and looks like it's working.

Thanks Dave, Jess and Antonio!


Quoting Dave DeMay <->:

>
>
> I only jar the wt and com packages (folders) under codebase as
> separate jar files. You can zip them and change file extension to
> jar - works the same. The only jar file you will need if you
> create custom webject in Info*Engine is the ie.jar under WEB-INF/lib
>
>
>
> Jar idea is good otherwise if you revise a class it may try to
> resolve your old version of the class on the classpath. Be careful
> whatever you do because the auto builds will try and compile and/or
> copy the entire codebase to a build directory which wastes a lot of
> time and can eat up CPU.
>
>
>
> I don't know how many ANT guru's are on here, but you can still
> achieve code completion and have a custo. build and deployment
> script with ANT and just disable all the auto builds, etc. I
> cannot share mine, but can provide insight into windchill and ant if
> anyone is interested.
>
>
>
> I manage all customizations in a project like setup and typically
> will use a source code repository like Subversion, CVS, SourceSafe
> to manage the details.
>
>
>
> David
>
>
>
>
>
>
11 REPLIES 11
jessh
5-Regular Member
(To:sdrzewiczewski)

P.S. You can use an Ant script to jar up **/*.class rather than wt/* and
com/* as needed. This will omit other stuff but make sure you get all
the classes.

Stephen Drzewiczewski wrote:
> I just did the zip of wt and com and looks like it's working.
>
> Thanks Dave, Jess and Antonio!
>
>
> Quoting Dave DeMay <->:
>
>
>> I only jar the wt and com packages (folders) under codebase as
>> separate jar files. You can zip them and change file extension to
>> jar - works the same. The only jar file you will need if you
>> create custom webject in Info*Engine is the ie.jar under WEB-INF/lib
>>
>>
>>
>> Jar idea is good otherwise if you revise a class it may try to
>> resolve your old version of the class on the classpath. Be careful
>> whatever you do because the auto builds will try and compile and/or
>> copy the entire codebase to a build directory which wastes a lot of
>> time and can eat up CPU.
>>
>>
>>
>> I don't know how many ANT guru's are on here, but you can still
>> achieve code completion and have a custo. build and deployment
>> script with ANT and just disable all the auto builds, etc. I
>> cannot share mine, but can provide insight into windchill and ant if
>> anyone is interested.
>>
>>
>>
>> I manage all customizations in a project like setup and typically
>> will use a source code repository like Subversion, CVS, SourceSafe
>> to manage the details.
>>
>>
>>
>> David
>>
>>
>>
>>
>>
>>
>

Instead of creating the jar file with Ant (non-Ant guru here), I read where you can jar all the classes through a list file (txt):

From codebase (d:\ptc\Windchill_9.1\Windchill\codebase):

dir /s /b *.class>class.list

jar cf wc_codebase.jar @class.list

I'm still waiting to see if it works.

My question is, if you created a list that included all jars & classes (into one jar) under codebase, would the IDE (eclipse in particular) be able to see all classes within the jars that were collected into the main jar (as above with wc_codebase.jar).

Then I thought about doing the same thing from parent folder (d:\ptc\Windchill_9.1\Windchill), so it would catch WEB-INF, srclib, ant, Upgrade, prog_examples, etc.

Not sure, but I think srclib & codebase have duplicate& different/separate classes (wt & com classes, stored in scrlib jars).

If so, will if find conflict with the duplicate class names maybe from srclib?

So I guess I have 2 questions.

1) Will the IDE (eclipse) see the classes within the multiple jars, that are within the main jar?

2) If so, will it find conflicts if I jar the whole windchill dir (d:\ptc\Windchill_9.1\Windchill)?

Its late & I may not be thinking properly, but I'm just trying to catch all possible classes (in jar&/or not).

I did attach a file to show all jar files below windchill folder (d:\ptc\Windchill_9.1\Windchill [dir /s /b *.jar>wc_jar_list.txt] ).

If I cant jar all classes & jars into one main jar, can the gurus point out the jars in the attached list that should be added to my IDE Project Libraries?

Thanks
L Jett
cadjett@aol.com;datajett@aol.com

It looks like I might need to gather classes & jars from one folder higher (d:\ptc\Windchill_9.1\), so I can catch some tomcat jars.

I got an email from Dave Demay (who is helping me with eclipse, as I throw effort towards his new/better javadoc):

"You will also need to get servlet-api.jar and jsp-api.jar from tomcat/bin/lib folders".

So I created a new jar list file:

D:\ptc\Windchill_9.1>dir /s /b *.jar>wc91_jar_list.txt (attached)

Getting hairy now.

jessh
5-Regular Member
(To:sdrzewiczewski)

On 1/20/2011 2:52 AM, Lawrence Jett wrote:
> Instead of creating the jar file with Ant (non-Ant guru here), I read
> where you can jar all the classes through a list file (txt):
>
> From codebase (d:\ptc\Windchill_9.1\Windchill\codebase):
>
> dir /s /b *.class>class.list
>
> jar cf wc_codebase.jar @class.list
>
> I'm still waiting to see if it works.
@class.list works fine -- that's how MakeJar.xml builds jars (even
though it's an Ant script it still uses jar to do the jar stuff for
various reasons).

That said, you need ensure each entry in @class.list is a *relative*
path from codebase, e.g. com\ptc\core\foo.class, not
D:\ptc\Windchill\codebase\com\ptc\core\foo.class. Figure out how to get
relative rather than absolute paths and you're all set. A quick look at
dir /? and I don't see how -- but I could be missing things. Using
Cygwin and skipping to good 'ole UNIX commands and you certainly could
have it quick enough.
> My question is, if you created a list that included all jars & classes
> (into one jar) under codebase, would the IDE (eclipse in particular)
> be able to see all classes within the jars that were collected into
> the main jar (as above with wc_codebase.jar).
IDEs won't see jars within a jar as being part of the classpath.
> Then I thought about doing the same thing from parent folder
> (d:\ptc\Windchill_9.1\Windchill), so it would catch WEB-INF, srclib,
> ant, Upgrade, prog_examples, etc.
>
> Not sure, but I think srclib & codebase have duplicate &
> different/separate classes (wt & com classes, stored in scrlib jars).
You almost certainly want essentially the same classpath the Windchill
server uses -- just using a jar of codebase classes rather than
codebase. So you'll want to collect all classes from codebase into a
jar as you're attempting above but use separate IDE project classpath
entries for the jars in codebase/WEB-INF/lib and WT_HOME/lib. As with
Windchill itself the entries should be codebase (or its jar
representation), then codebase/WEB-INF/lib jars and finally WT_HOME/lib
jars.

srclib is duplicate -- and exists if you really wanted your code to only
reference specific Windchill modules -- though that seems unlikely.
> So I guess I have 2 questions.
>
> 1) Will the IDE (eclipse) see the classes within the multiple jars,
> that are within the main jar?
Not to the best of my knowledge.
> If I cant jar all classes & jars into one main jar, can the gurus
> point out the jars in the attached list that should be added to my IDE
> Project Libraries?
See above.

--
Jess Holle

jessh
5-Regular Member
(To:sdrzewiczewski)

On 1/20/2011 2:57 AM, Lawrence Jett wrote:
> By the way, I didnt do the zip thing, because of all the non class
> items (html, etc) & I wanted to catch any classes outside the com/wt
> folders (like Jess mentioned).
>
> I liked the Jess Ant suggestion, but I seen the jar cf **/.class &
> that didnt work command line, so I tried the pipe to list & jar cf
> *.jar @*.list & it looks like it worked ok & should be much smaller
> that a zip & contain classes that wont be in com/wt.
I believe you just need the following Ant script:


<project basedir="." default="all" name="MakeCodebaseJar">

<target name="all">
<jar basedir="." destfile="wtCodebase.jar" includes="**/*.class"/">
</target>

</project>

Place that in codebase, e.g. as MakeCodebaseJar.xml, and invoke it there
with Ant environment variables properly set up (as they are in a
Windchill shell) via "ant -f MakeCodebaseJar.xml".

--
Jess Holle
jessh
5-Regular Member
(To:sdrzewiczewski)

P.S. I verified that this Ant script does the trick.

I'm lazy. I use 7-zip or winrar and zip up directories and then rename the
extension to .jar. Having a manifest file in this case is useless.


jessh
5-Regular Member
(To:sdrzewiczewski)

Yes, the manifest is useless here. The point was to zip up only the
class files and nothing else. I don't know how to do that with the GUI
oriented tools you mention -- perhaps I'm just ignorant.


That makes the both of us Jess, sure there is a way. I just told Lawrence that he needs the wt and com directories under codebase. I typically jar them seperately and don't care if I get an occasional xconf, property file, etc. in those jars. Emphasize lazy. 😉



Sent from my Verizon Wireless BlackBerry


I just used your script & it worked great. Much, much appreciation. Now I will read the rest of the posts on this topic & see if anybody posted the jars I need to add to my eclipse project library.

Thanks a bunch
L Jett


In Reply to Jess Holle:

I have you both beat. I am Lazy & Ignorant.

I teach a class for it at the local University....ha..ha

L Jett
Top Tags