David Newton wrote:Where are you trying to compile the file from (what directory)?
sony vijay wrote:
I am assuming that HelloWorld.java file is wrapped in my\package (package structure).
sony vijay wrote:
C:\>javac -classpath .;C:\myclasses\here\my\package HelloWorld.java
It still gives a file not found error
Did you set your classpath before executing Henry's suggestion? If so, which part didn't work?I tried this. It doesn't work.
sony vijay wrote:import my.package.*;
sony vijay wrote:
But, am still getting the file not found error. I saved the file using Notepad in Windows 7. So, I guess it attaches a .txt to the filename. Is this the problem ? If am using Windows7 how do I save file with .java extension ?
sony vijay wrote:Where do I set my classpath ?
In C:\ ? or C:\users\sony\ or C:\myclasses\here ?
sony vijay wrote:Ok.
Now, I shifted two levels above in the directory structure...meaning I am running from the C:\ directory
I tried this:
C:\>javac -classpath .;C:\myclasses\here\my\package HelloWorld.java
It still gives a file not found error
sony vijay wrote:I compiled the file as shown below:
C:\myclasses\here>javac my\package\HelloWorld.java
I got this error :
my\package\HelloWorld.java:1: <identifier> expected
package my.package;
1 error
The government thinks you are too stupid to make your own lightbulb choices. But this tiny ad thinks you are smart:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|