No idea what that means. My Notepad is an editor. I use it to create text files.
Type: Posts; User: Norm
No idea what that means. My Notepad is an editor. I use it to create text files.
I use frequently use batch files. Knowing how to write them will be useful for you.
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...
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.
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:
Use a batch file with the full commandline to save entering the full classpath and other commandline options.
-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...
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...
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...
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...
The three things in the test folder:
FixChap5.java
FixChap5.class
package1 folder
The package1 folder should have:
Bootclasspath.java
Bootclasspath.class
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...
Please post the full text of the error messages.
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.
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;...
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....
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...
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...
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...
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...
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.