Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

  1. [SOLVED] Re: How to referenc a class file. using only notepad and run cmd.

    No idea what that means. My Notepad is an editor. I use it to create text files.
  2. [SOLVED] Re: How to referenc a class file. using only notepad and run cmd.

    I use frequently use batch files. Knowing how to write them will be useful for you.
  3. [SOLVED] Re: How to referenc a class file. using only notepad and run cmd.

    The FixChap5 is not involved at all in the above.
    Look at the Bootclasspath program. It has a main() method that is being called by the java program.


    There is no package named: PathToPackage1...
  4. [SOLVED] Re: How to referenc a class file. using only notepad and run cmd.

    Create a batchfile that contains the full commandline you use to execute the java program.


    Where did that line come from? That is not a valid commandline.
  5. [SOLVED] Re: How to referenc a class file. using only notepad and run cmd.

    On windows a batch file's extension is .bat. I use them for executing test programs. You enter the name of the batchfile and windows reads it and executes it contents.
    Here's a sample:
  6. [SOLVED] Re: How to referenc a class file. using only notepad and run cmd.

    Use a batch file with the full commandline to save entering the full classpath and other commandline options.
  7. [SOLVED] Re: How to referenc a class file. using only notepad and run cmd.

    -cp short for -classpath

    You won't want to set the ENVIRONMENT variable for every set of programs you write. Use the -cp option on the javac and java commands. Make a batch file with the...
  8. [SOLVED] Re: How to referenc a class file. using only notepad and run cmd.

    Yes, I left out the pointer to the current directory (.)

    Separate the two paths with a ; not a space:
    java -cp .;PathToPackage1 FixChap5

    Here the classpath points to the current folder where...
  9. [SOLVED] Re: How to referenc a class file. using only notepad and run cmd.

    The javac and java commands are entered in a command prompt on commandlines. You add options to a command by putting them on the command line folowing the name of the command.
    For example:
    java...
  10. [SOLVED] Re: How to referenc a class file. using only notepad and run cmd.

    I assume the code compiles and executes now. It using the current directory (.) as the classpath.
    We'll change the exercise so you need an explict -classpath value to find the class file in the...
  11. [SOLVED] Re: How to referenc a class file. using only notepad and run cmd.

    The three things in the test folder:
    FixChap5.java
    FixChap5.class
    package1 folder

    The package1 folder should have:
    Bootclasspath.java
    Bootclasspath.class
  12. [SOLVED] Re: How to referenc a class file. using only notepad and run cmd.

    Which of the steps I asked you to do in post#20 were skipped or done differently than I suggested? For example I did not say to execute the Bootclasspath program. What else did you do?

    Restore...
  13. [SOLVED] Re: How to referenc a class file. using only notepad and run cmd.

    Please post the full text of the error messages.
  14. [SOLVED] Re: How to referenc a class file. using only notepad and run cmd.

    I did not say to execute the Bootclasspath program. That will require setting the classpath.
    You were to execute the FixChap5 program the same way you did it before.
  15. [SOLVED] Re: How to referenc a class file. using only notepad and run cmd.

    Now to the use of package and import statements:
    create a folder: package1 in the folder which the FixChap.java is in.
    Move the Bootclasspath files to that folder.
    Add a package package1;...
  16. [SOLVED] Re: How to referenc a class file. using only notepad and run cmd.

    I am trying to do this one step at a time.
    When you have the two class files so that they compile and execute using only one folder and no import statement, we'll move one step to using a package....
  17. [SOLVED] Re: How to referenc a class file. using only notepad and run cmd.

    If the .java and the .class files are in the same folder, there should not be a problem.
    Why is the import Bootclasspath.*; statement there? Using that entails classpath and folder usages that you...
  18. [SOLVED] Re: How to referenc a class file. using only notepad and run cmd.

    Do you have a set of classes that compile and execute without packages, import statements or classpath settings? You need to start from a known working position.

    Can you list the names of the...
  19. [SOLVED] Re: How to referenc a class file. using only notepad and run cmd.

    If everything is in one folder you do not need import statements or classpath settings. When you get a working group of classes THEN work on the next step: putting a class in a package and using an...
  20. [SOLVED] Re: How to referenc a class file. using only notepad and run cmd.

    Try doing a more simple exercise without packages so you will not have to worry about classpath just yet. Remove the package statement from all the source and put all the .java files in the same...
  21. [SOLVED] Re: How to referenc a class file. using only notepad and run cmd.

    Both the javac and the java commands have commandline options to specify the classpath to use. Look at the doc for those commands to get the correct syntax.
Results 1 to 21 of 21