1 Reply Latest reply: Mar 7, 2010 8:38 AM by 800560 RSS

    How to compile a single file in a project

      I have placed my java connector file called "xxxTargetconnector .class" in the below mentioned path


      I have converted the above class file in to a java file using a decompiler.Now i would like to recompile the java file to get the byte code.This class file imports many class files from jar files which is placed in the below mentioned path.


      Before compiling i set the path to include the jar files

      for ex , set path = D:\FSCM9DMO\webserv\Cybersource

      For compilation i went to the below path using command prompt and compiled the particular file.

      D:\FSCM9DMO\webserv\FSCMDMO9\applications\peoplesoft\PSIGW\WEB-INF\classes\com\peoplesoft\pt\integrationgateway\targetconnector>javac xxxTargetConnector.java

      Unfortunately i got around 99 errors saying

      xxxTargetConnector.java:187: cannot find symbol
      symbol : variable Logger
      location: class com.peoplesoft.pt.integrationgateway.targetconnector.xxxTargetConnector

      How to compile a single file in a project ?
        • 1. Re: How to compile a single file in a project
          According to [http://java.sun.com/javase/6/docs/technotes/tools/windows/javac.html],
          "As a special convenience, a class path element containing a basename of * is considered equivalent to specifying a list of all the files in the directory with the extension .jar or .JAR.
          I have never tried using this feature.

          So if all of your dependent classes are in in jar files that are in D:\FSCM9DMO\webserv\Cybersource, a command like the following should work.

          javac -cp D:\FSCM9DMO\webserv\Cybersource\* xxxTargetConnector.java

          Note that setting your operating system path variable has no impact on where Javac looks for dependent classes.