Forums Register Login

Compiling Issue

+Pie Number of slices to send: Send
Hello Ranchers!

I'm trying to work through the MVC tutorial in the Head First Servlets & JSP book. I've set up my development and deployment environments as illustrated, copied the code, and now want to compile.

I've written a .bat file to help me do this. However, the JVM cannot find the BeerExpert source file.

Here is my .bat file:




Any suggestions would be appreciated! Thanks again!
+Pie Number of slices to send: Send
Are you having compile or runtime errors?
Could you post the error messages?

You are showing a javac command in the batch file which does not start a jvm.
The java command starts the jvm.

Are the source files in packages? Then the classpath must be set to point to the start of the package path.
+Pie Number of slices to send: Send
Here is the error message

BeerSelect.java:3: package com.example.model does not exist
import com.example.model.BeerExpert;
^
+Pie Number of slices to send: Send
Norm,

I got it! After reading your response more carefully

"Are the source files in packages? Then the classpath must be set to point to the start of the package path."

I realized I was not doing that correctly.

Thanks again!
please buy my thing and then I'll have more money:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 750 times.
Similar Threads
Classpath, Packages, etc.
Compiling custom imports
"Package does not exist" compilation error
can't import own model
Compiling a Servlet
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 07:37:22.