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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

JLink Techniques to Determine Platform (32 vs. 64-bit)


JLink Techniques to Determine Platform (32 vs. 64-bit)

Hi Everyone -

I have a JLink application which relies a Pro/Toolkit task DLL - JLink
doesn't support drawing format symbol groups on Wildfire 3. I can use
the same Java code on both 32-bit and 64-bit Windows, but I need different
versions of the DLL for each.

Is there a way a JLink program can determine at run-time which platform
Pro/E is running on? If my program knows it's running in a 64-bit env-
ironment, then it can load the 64-bit DLL instead of the 32-bit.

If there isn't a specific JLink method, can anyone suggest a
option or environment variable that is unique to either platform?

|+| M a r k |+|

Mark Stallard
Engineering Information Management
Integrated Solutions & Development
Integrated Defense Systems
Raytheon Company

(tie line)

880 Technology Drive
Billerica, MA 01821

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.

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.

Wow, I think this will be my "first" J-Link related response on this forum.

I don't believe there are any J-Link specific methods to determine if the architecture of Pro/ENGINEER (32 vs 64). However; Java has some functions to retrieve OS architecture information. If Raytheon has a standard of loading 64 bit Pro/ENGINEER on 64 bit Windows then you can make the assumption based upon the OS. Try the following.

public class OpertingSystemInfo
public static void main(String[] args)
String nameOS = "";
String versionOS = "os.version";
String architectureOS = "os.arch";
System.out.println("\n The information about OS<");">>");
System.out.println("\nName of the OS: " +
System.out.println("Version of the OS: " +
System.out.println("Architecture of THe OS: " +

Patrick Williams | Engineering Systems | Sr. Applications Engineer | Steelcase Inc. | 616.698.4078


Hi Mark,

You can probably just check the environment variable PRO_MACHINE_TYPE.
It's set when Pro/E starts and it will either be:

i486_nt or x86e_win64 based on which architecture of Pro/E you run.

You don't want to check the OS architecture because you can run the 32
bit version of Pro/E on 64 bit so that would break your logic.

We do this in our protk.dat and have both 32 bit and 64 bit DLL's
available. It will start the correct architecture based on Pro/e.

This is an example from our Protk.dat

exec_file c:\dev\toolkit\$PRO_MACHINE_TYPE\Toolkit.dll

I then have 2 folders. One called i486_nt with the 32 bit version of the
DLL and the other called x86e_win64 with the 64 bit version.

Example folder structure:




Doing it this way means you share the menu files, text files etc. but
just segregate the DLL to be specific to the architecture.

This works well with Pro/TOOLKIT so I'm guessing the same logic can
apply to J-Link.



That is a perfect way to do this. Thanks for the technique.

Patrick Williams | Engineering Systems | Sr. Applications Engineer | Steelcase Inc. | 616.698.4078



I was following this discussion and saw the solution of checking the environment variable PRO_MACHINE_TYPE, which definitelylooks like the best place to get it from. But my question to the group is - from JLink, what's the best way of getting an OS environment variable?

The System.getProperty() method only gets JVM system properties.The only way I could think of was to set the option for the JLINK_JAVA_COMMAND with a "-Dpro_machine_type=%PROE_MACHINE_TYPE%" option to pass the value (if that would even work). Is there a better way?


Gary Hoffman

Solar Turbines Inc

Check out this link. Google search "get environment variables in java".

NEW Creo+ Topics: PTC Control Center and Creo+ Portal