compiler errors - How to compile java classes which are inside multiple folders? -


i new java world. have got few classes inside nested folders.

my namespace has following folder structure (assume companyname folder on c:\ ):

 companyname -> isuname -> projectname -> module1 -> sampleclass1.java companyname -> isuname -> projectname -> module2 -> sampleclass2.java companyname -> isuname -> projectname -> module3 -> codepart3.1 -> sampleclass3.java companyname -> isuname -> projectname -> module3 -> codepart3.2 -> sampleclass4.java 

my problem is, want compile of these classes command prompt.

i tried following command not working :

c:\> javac -sourcepath companyname\*.java 

but not working. getting following error :

javac: no source files usage: javac <options> <source files> 

please compile of these classes , possibly create jar out of it.

i looked @ the manual page javac, , seems you'll have spell out source files on command line, or you'll have list them in separate file, , reference file on command line.

i set first 2 source files in question in similar tree, , compiled them follows:

c:\>"\program files\java\jdk1.6.0_24\bin\javac.exe" company\isu\project\module\hellojava.java company\isu\project\module\byebye.java 

using other method, produced file:

c:\>type sourcefiles.txt company\isu\project\module\hellojava.java company\isu\project\module\byebye.java 

then fed file javac compiler, prepending "@" specifier per manual.

c:\>"\program files\java\jdk1.6.0_24\bin\javac.exe" @sourcefiles.txt 

the manual page jar doesn't seem yield same techniques, specified files on command line before.

c:\>"\program files\java\jdk1.6.0_24\bin\jar.exe" -cf myjar.jar company\isu\project\module\hellojava.class company\isu\project\module\byebye.class 

of course, doing way tedious, highly recommend ant, can run on windows.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -