Hello, i'm trying to compile my java file through the command line, but i have lots of packages and one jar file in which my code is dependent. how do i do this? here is a sample hierarchy of my packages. (I'm doing this in Mandriva)
-- Folder1 //note: these packages contain only the .classes of the codes - packageA - packageB - packageC -- Folder2 - codeToCompile.java -- jar file
how do i compile this? thanks! I have no idea how to use javac -cp for multiple classpaths. thanks! any help would be really great!
hi, i already tried doing this before, but it doesn't work. these codes are actually made with eclipse, that's why it's quite easy working with packages. but now that i need to use the command line for it, i'm having some difficulties =( you also have to know that some of the class files in Folder1 are files from the jar file with some added methods. I'm guessing that the files in the jar file are overriding these new codes from folder1 that's why they're not recognized? Do you think that's it? thanks!
The jar files have internal packages too, make sure that you import them as well. If you use windows, you can set the environment variables. you can also externally set the classpath in command promt, using the command
set classpath=%classpath%;<path of your jars,classes etc.>