packages are created (logically)as they are declared, using the "package" keyword. the JLS governs that. the compiler will create a directory structure that "reflects" your package names. maybe you could post the errors you are getting with yr code, so we could help out? regs peter
hello whenever i try to compile a class file in a package after setting CLASSPATH i get the following error message E:\jdk1.4\bin\lab>javac toy.java 'javac' is not recognized as an internal or external command, operable program or batch file. E:\jdk1.4\bin>javac toy.java error: cannot read: toy.java 1 error
'javac' is not recognized as an internal or external command, operable program or batch file. This is a PATH issue, not a CLASSPATH issue. The CLASSPATH is concerned with locating Java class files. The PATH is concerned with locating executables, like .exe files. You probably want to adjust your PATH setting to include the location of javac.exe (which is included with your Java 2 SDK installation).
E:\jdk1.4\bin>javac toy.java error: cannot read: toy.java Where is toy.java located? It must not be in the E:\jdk1.4\bin directory. Is it in the E:\jdk1.4\bin\lab directory? If it is, then try E:\jdk1.4\bin>javac lab\toy.java Note that the CLASSPATH setting isn't concerned with locating Java source files, it specifies the location of compiled classes.
Actually if there is a class file in a package. To execute it from the package iam setting CLASSPATH but it is not working. The lab package is in JDK1.4\bin\lab. Please help.
Hello, After u set the path for javac compiler and the following is the procedure I used for compiling and accessing my java files in the package. I have a folder in the F:\Programs\Java\mypack The CLASSPATH is set to F:\Java\Programs (i.e the classpath has to be set to the parent folder in which the package resides i.e to the F:\Java\Programs because the mypack folder resides in F:\Java\Programs\mypack ) To compile them u need to compile them in the following way. F:\Programs\Java>javac mypack\*.java Cheers, Gaya3 ------------------------------------------------- Beginning is half done
Don't get me started about those stupid light bulbs.