1

I am trying to compile a simple Hello World from windchill shell using command javac com.A.B.Test. But it is displaying could not find main class error.

Varun
  • 76
  • 1
  • 9

4 Answers4

0

I think your problem is Java and not Windchill related.

Let's say your Java source file is stored in the following location:

/src/com/A/B/Test.java

To compile that file in shell (Linux for example):

cd /src
javac com/A/B/Test.java

To run that file (if it contains a main method):

java -cp /src com.A.B.Test
JanTheGun
  • 2,165
  • 17
  • 25
0

Try using the below command from the windchill Shell. Hope you are following the default file structure provided by the Vendor i'm providing the same below otherwise just edit the path mentioned in the below command.

javac -d codebase -cp %CLASSPATH%;%WT_HOME%\srclib\tool\Annotations.jar src*.java

techjunkie
  • 59
  • 1
  • 11
0

First Go to Windchill Shell then navigate to the folder where java file is present. At that location type javac Test.java and press enter.

Maninder Singh
  • 135
  • 4
  • 12
0

Put the code into WT_HOME/src/com/package, than run from WT_HOME:

ant -f bin/tools.xml class -Dclass.includes=com/..path-to-package/*
Simon MᶜKenzie
  • 8,344
  • 13
  • 50
  • 77
Erik
  • 3
  • 1
  • 4