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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

while running pfcAsyncStartExample getting a error called Error: Could not find or load main class

SOURABH
5-Regular Member

while running pfcAsyncStartExample getting a error called Error: Could not find or load main class

package com.ptc.jlinkasyncexamples;

import com.ptc.cipjava.*;
import com.ptc.pfc.pfcSession.*;
import com.ptc.pfc.pfcModel.*;
import com.ptc.pfc.pfcAsyncConnection.*;


/**
* This asynchronous class is a simple asynchronous application. It makes
* Pro/ENGINEER run in batch mode, without user input. The application
* starts Pro/ENGINEER, performs the designated operations, and shuts down
* Pro/ENGINEER.
*/
public class pfcAsyncStartExample {

public static void main (String [] args)
{
System.loadLibrary("pfcasyncmt");
runProE();
}

public static void runProE()
{
try
{
// Second Argument: String path to menu and msg files.
// null assumes no msg and menu files used in this batch application.
// -i and -g flags make Pro/ENGINEER run in non-graphic, non-interactive mode.
AsyncConnection connection =
pfcAsyncConnection.AsyncConnection_Start("pro -g:no_graphics -i:rpc_input",
null);

Session session = connection.GetSession();

/* J-Link processing calls here */

//null third argument designates model is not an instance.
ModelDescriptor desc = pfcModel.ModelDescriptor_Create(ModelType.MDL_PART, "modelname",null);
Model model = session.RetrieveModel(desc);

// end the Pro/ENGINEER process when done
connection.End();
}

catch (jxthrowable x)
{
System.out.println("Exception: " + x);
}
}
}

 

Error: Could not find or load main class PfcAsyncStartExample ?????

 

How to run this or to clear this error

2 REPLIES 2
VladimirN
24-Ruby II
(To:SOURABH)

 Hi,

 

Read the following article - "OTK JAVA Free samples pfcAsyncFullExample.java & pfcAsyncStartExample.java loads incorrect Library "jotkasync". The correct Library should be "pfcasyncmt" in Creo Parametric": https://www.ptc.com/en/support/article/CS312023

 

SOURABH
5-Regular Member
(To:VladimirN)

I have applied that pfcasyncmt ? but also main class is not running

 

Top Tags