Sourcepath option returns javac: no source files

I'm using Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
on win xp SP2
I have folder structure as follows:
C:\temp\java\src\HelloWorld.java
C:\temp\java\src\com\trial\level\test\HelloWorld2.javaI'm trying to compile the files using sourcepath option but it seems it is not working, I'm using the following cmd command:
C:\temp\java>javac -sourcepath ./src -d ./classes -verboseBut getting this error:
C:\temp\java>javac -sourcepath ./src -d ./classes -verbose
javac: no source files
Usage: javac <options> <source files>
where possible options include:
  -g                         Generate all debugging info
  -g:none                    Generate no debugging info
  -g:{lines,vars,source}     Generate only some debugging info
  -nowarn                    Generate no warnings
  -verbose                   Output messages about what the compiler is doing
  -deprecation               Output source locations where deprecated APIs are used
  -classpath <path>          Specify where to find user class files
  -cp <path>                 Specify where to find user class files
  -sourcepath <path>         Specify where to find input source files
  -bootclasspath <path>      Override location of bootstrap class files
  -extdirs <dirs>            Override location of installed extensions
  -endorseddirs <dirs>       Override location of endorsed standards path
  -d <directory>             Specify where to place generated class files
  -encoding <encoding>       Specify character encoding used by source files
  -source <release>          Provide source compatibility with specified release
  -target <release>          Generate class files for specific VM version
  -version                   Version information
  -help                      Print a synopsis of standard options
  -X                         Print a synopsis of nonstandard options
  -J<flag>                   Pass <flag> directly to the runtime system
javac: no source filesplz can anyone help as I have lots of classes & in lots of directories and sourcepath option is vital for me.

I'm trying to compile the files using sourcepath
option but it seems it is not working, I'm using the
following cmd command:
C:\temp\java>javac -sourcepath ./src -d
./classes -verboseBut getting this error:
C:\temp\java>javac -sourcepath ./src -d
./classes -verbose
javac: no source files
Usage: javac <options> <source files>
where possible options include:I believe -sourcepath is used to specify where javac should look for dependent classes' source code. The command you posted does not inclue any target file(s). I think you are looking for something like javac -d ./classes -verbose ./src/*.java

Similar Messages

  • Standard Options in javac, Help!

    Hi,
    I'm completely new to the Java platform and was wondering what (exactly) to type in Windows Command Prompt when is want to change where javac searches for input source files (ie. the -sourcepath command).My source files are located in C:/Program Files/Java/workspaces/source files.
    I'v tried the following, but program can't find the source files (ie files with a .java-ending):
    javac -sourcepath C:/Program Files/Java/workspace/source files
    javac -sourcepath C:/Program_Files/Java/workspace/source_files
    I get this kind of error:
    javac: invalid flag: Files/Java/workspace/
    How do i fix this? The answer would help me to use other javac commands as well, eg. -d, -g etc.....

    Thanks for your help so far; i dont get the same error as before, but i still can't compile any of my source files without defining the entire path all over again
    the program also states
    javac: no source files
    Any ideas?
    Thanks for you help.

  • Sender File adapter not deleting the source file after reading

    Hi everyone,
    In the sender Communication channel i have choosen the "Delete" option after reading the source file. But it is reading the file, but it is not deleting the file. I have checked the file status. it is with full persmission.
    can anyone give solution to this.
    Thanx
    Bala

    Hi,
    1. set the mode to delete
    2. make sure the file is "deletable"
    3. check xiserver:port/MessagingSystem/monitor log to see what happens with the file
    (chec both audit and log in that link)
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • The Server application, source file, or item can't be found, or returned an unknown error. You may need to re install the server application

    Hello All, can anybody help?
    The Problem
    We are running SharePoint 2013 and document sets that have an excel file and a PowerPoint presentation both in the document set folder  and we have mapped this to a unc path
    \\SP.companyname.com\@SSL\DavWWWRoot\Documents
    Once a link(graph) is added from excel 2010 (Ctrl C) then go into PowerPoint 2010 Paste > paste special > paste link (As Microsoft Excel Chart Object) click ok the graph goes into the PowerPoint presentation.
    The graph/Table is added but in Power point 2010. Perfect.
    The problem is when we close excel and try and click on the graph(link) we get the following error “The Server application, source file, or item can’t be found, or returned an unknown error. You may need to reinstall the server
    application”
    If we right click then we get
    The Linked file was unavailable and can’t be updated
    Has anybody else experienced this issue?
    We are running SharePoint 2013 and document sets that have the excel file and PowerPoint in and we have mapped this to a unc path
    \\SP.companyname.com\@SSL\DavWWWRoot\Documents
    I think that Office 2010 does not link or cannot link to a url which it see the unc path as?? It works in Office 2013 but we have Office 2010 as standard across the firm also I have tried SP1 and SP2 for Office 2010 but still
    no joy 
    Is anybody else experiencing this issue? is there at least a work around?
    Many thanks in Advance
    Jake

    Hi,
    Usually this issue is caused by the Protected Mode in Adobe software, since it's not a Microsoft product, the information I can provide is quite limited. I suggest you contact the support of Adobe first, ask if they can provide any suggestion.
    Regards,
    Melon Chen
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Archive Source Files with Errors, Option Does not work

    Any one tried "Archive Source Files with Errors" on the
    sender adapter. It shows no effect.
    1.We are on SP19.
    2.Adapter type : FTP adapter.
    Steps for the Reconstruction 
    1. Configure a sender FTP adapter.
    2. choose the option "Archive Faulty source files"
    3. Specify a directory for "Directory for archiving Files with Erroors"
    4. Send a file which can cause File Content conversion errors.
    Regards,
    Raj

    Hi,
    FYI
    I am in PI 7.0 SP 10. It works fine for me. Whenever you have any content conversion problem or module problem, it has created the same input file in specified directory.
    In your case are u getting content conversion error in the Communication Channel ..just cross check it. If not try to get error over there and then test this feature
    Rgds,
    Moorthy

  • Where the default location of generated source files?

    Hello!
    In my processor I create several source files and check it's names for existance before
    private String genClassName( final String packageName, final String key, final String suffix )
            final StringBuilder suggest = new StringBuilder( packageName ).append( key ).append( suffix );
            final Elements elementsUtil = processingEnv.getElementUtils();
            int i = 0;
            while( elementsUtil.getTypeElement( suggest ) != null )
                suggest.append( i++ );
            return suggest.substring( packageName.length() );
        }If I not define -s option for javac at first time compile and then set it to some location, then some generated before files are visible for this method and numbers added.
    So, the question: where to find a default "shadow" source tree to clean up it before next compilation with changed -s option?
    Sorry for my english and thanks for answers
    Edited by: Maxoid2 on Jun 3, 2008 10:34 PM

    The directory to clean up is where the -s option pointed to last time.
    The simplest way to do this is to always use the -s option and don't change it. Using the default value for -s option (which is the same as -d) tends to lead to problems. I always specify -s option, and make it different to -d option and -sourcepath.
    If you do this you don't even have to clean it up, javac only looks in there for files that it placed there. Files from previous builds get overwritten. Files from previous builds that are not overwritten are ignored.
    with a separate -s directory, it just works.
    Bruce

  • UDF to capture the source file name or the source folder for mapping

    Hi All,
    i have 2 files -  File1 from File2 from 2 different folders- single comm channel FTP (FCC). i have to pass a constant A and B respectively to a field in target structure.
    my options are -
    either create a new field in source str populating different constants and  then map to the target str
    or a udf to get the source file name or the source folder so that i can map the constant using the value mapping/FixValue mapping.
    please suggest. thanks.
    rajib

    Hi,
    please use the UDF to determine the file name. Then based on file name either pass A or B to your target field.
    The code is as given below. Just tweak the code to pass either A or B as per your requirement.
    public String G_GetFileName(Container container) throws StreamTransformationException{
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String ourSourceFileName = conf.get(key);
    return  ourSourceFileName; 
    Regards,
    Deepak.

  • Jdb in java 1.3.1 not listing source file...

    Hi,
    I'm trying to use the remote debugging option Xdebug for my server. If I attach using jdb -attach, I'm not able to list my source file using list command. It says Source file not found. I tried various means, -Denv.class.path, etc. nothing works. the use command is always showing "." I'm able to attach put breakpoints, stop the server code etc. please help.

    it finally worked if I start the jdb from the ROOT dir. Then it takes the class path for the sources. But still, changing the "sourcepath" inside jdb is of no help.

  • Compile source files from multiple subdirectories

    Hi. we know that we can compile multiple source files in a folder with the statement:
    javac -classpath . *.java
    How can we compile multiple source files that belong to different subfolders without using an IDE?
    Example:
    folder1, folder2, & folder3 all have .java source files, and all 3 folders belong to a folder named bigfolder;
    what is the shortest way to compile those source files in one statement like the one above?

    It should work withjavac -classpath your_classpath folder1\*.java folder2\*.java folder3\*.javaJust make sure that your_classpath allows all of the classes to be found.
    It might be better to use the -d option in your case.javac -d path_for_classes folder1\*.java folder2\*.java folder3\*.javaYou just specify the directory into which the .class files and their package directories should go.

  • Question about how javac finds referenced files.

    Hi
    I am just beginning to learn Java and have got some questions related to packages.
    I have two classes:
    MyClass.java
    package pkg;
    public class MyClass {
         public void prn(int x){
         System.out.println("Integer: "+x);
    Test.java
    import pkg.*;
    public class Test{
         public static void main(String[] args){
              MyClass obj=new MyClass();
              obj.prn(2);
    Directory structure
    /root/ jprog/MyClass.java
    /root/ jprog/Test.java
    Executing the following sequence of commands gives me:
    # ls
    MyClass.java Test.java
    # javac -d . MyClass.java
    # ls
    MyClass.java Test.java pkg/
    # cd pkg
    # ls
    MyClass.class -----compiles.
    # cd ..
    # javac Test.java
    Test.java:5: cannot access MyClass
    bad class file: ./MyClass.java
    file does not contain class MyClass
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    MyClass obj=new MyClass();
    ^
    1 error
    Now after reading another thread on this forum I came to know that the compiler finds the
    MyClass.java in the wrong package. Using verbose option with javac shows this.
    So I move it to some other directory and everything works.
    # mv MyClass.java /root
    # ls
    Test.java pkg/
    # javac Test.java
    # java Test
    Integer: 2
    Now the question begins:
    Suppose we go back to how the files were arranged before I moved the MyClass.java file and
    I change the Test.java file by adding
    package pkg2;
    statement to it.
    Now everything compiles
    # ls
    MyClass.java Test.java ---I have deleted pkg and .class files
    # cat Test.java
    package pkg2;
    import pkg.*;
    public class Test{
    public static void main(String[] args){
    MyClass obj=new MyClass();
    obj.prn(2);
    # cat MyClass.java
    package pkg;
    public class MyClass {
    public void prn(int x){
    System.out.println("Integer: "+x);
    # javac -d . MyClass.java
    # javac -d . Test.java
    # ls
    MyClass.java Test.java pkg/ pkg2/
    # java pkg2.Test
    Integer: 2
    Why isn't the MyClass.java file causing any problems now?
    Using the verbose option with javac shows that the compiler goes straight for the pkg/MyClass.class.
    My readings of Core Java Horstmann tell me that the compiler always looks in the current directory. javac documentation also doesn't help. I know that the documentation recommends that the source file locations should match the package statements.
    I'm just trying to learn how javac finds referenced files.
    Any help??
    Thanks a load in advance.

    I know that the
    documentation recommends that the source file
    locations should match the package statements.This is not merely a recommendation, it is a requirement.
    Both javac and java find classes by traversing the classpath. The classpath should contain directories (or jar files) that correspond to the top of a (part of the) package hierarchy.
    For example, if the Java code for your class is in a file C:\src\pkg\MyClass.java, and MyClass.java declares the class to be in package pkg, the classpath should contain C:\src. Classes are then found by transforming their package declaration into a directory structure.
    Please note that javac works on files, not classes. Therefore it is necessary to specify the full filenames of the files you want to compile, even if you have specified the classpath. By default, javac will put compiled class files in the same location as their sources, so the classpath for the java command should also contain C:\src.
    The exception to the rule is when all classes for the program are in the default package (i.e., they do NOT contain a package statement). In that case, it is possible for javac (and I believe java as well) to find all classes in the current directory, so it will "just work".
    You can specify the classpath using the -cp parameter to both javac and java.
    Hope this helps.

  • StackOverflowException compiling 8000 source file

    I am trying to compile a source file with ~8000 lines. It has many (hundreds) of static members (instances of that class), and methods containing conditional statements to take a string and return the instance of that name. This is generated code, so I do not think I can change it.
    Every time I try to compile it with Maven (Sun JDK 1.4.2_05) I get a java.lang.StackOverflowException. I have tried giving Maven more stack memory via the -Xss option (as much as 10m per thread), but that didn't help at all.
    I commented out 90% of the code and it works fine, so I know it is the size that is the problem.
    Has anyone had to deal with something like this before? If so, how did you fix it?

    Thank you to everyone who has replied. After some experimentation I discovered that the problem is not the 800+ static objects being created - it was the 1000's of lines of nested conditional statements. The generator has been modified to make if, if, if... instead of if, else-if, else-if, ... and all is well. :)
    I do not believe any sort of hard limit was reached, b/c Eclipse had no problem with the file. Also, one of our projects has a source file with 12k lines, and it works fine (though it has a different structure).
    I find it interesting that people are being so critical about the generator, especially since this is only one small piece of its modelling. The generator does far more than just create the key types and values.
    Furthermore, I don't understand the criticism of the code as-is. No, it's not something I'd write myself, nor would I wish to maintain such code - but no one has to! That's what the generator is for. If I want to add or delete a key type/value, I do so in the generator, and then regenerate the code.
    I also don't understand why anyone thinks this code is not object-oriented. Perhaps I just didn't explain it well. All classes representing key types extend AbstractDiscreteValue, so there's inheritance. The reason why all the values exist as static (and final) instances is b/c we never need more than one instance of each value, the values are known at generation time, and all instances are immutable.
    How would any of you construct such a class? Keep in mind that maintenance is not an issue, and most key types (probably 95% or more) have fewer than a dozen values.
    Anyway, thanks again for the help.

  • How to get a source file?

    I'm using Java 1.6 and extending AbstractProcessor to handle a custom annotation.
    What I want to do is load the source file in which my annotation is found and extract a few lines of the code from around the annotation into a text file and save the text file.
    I'm trying to use
    compiler#getResource(...) to get a reference to a FileObject for the source file. I have the correct package and file name for the source but I have been unable to determine how I get the root of the source path from which all the source files originate. If I try the code with source root hardwired it all works i.e I prepend the source root to the package name and call
    FileObject fObj = filer#getResource(StandardLocation.SOURCE_PATH, <src_root_string>+<package string>, fileName.java)
    then the fObj correct, but this is not a practical solution. Without the <src_root_string> I just get a file not found exception.
    So my question is how can I discover the source root folder from inside the AbstractProcessor and so not need to hardwire it in?
    Alternatively is this the best approach? Should I try another approach?
    Thanks

    Mike,
    You don't need a File to do what you want. Even if you could, it would be wrong to use a file.
    It would be wrong, because the compiler might not by using a JavaFileManager that is actually backed by a filesystem. It could be backed by some form of repository such as a database, or it could be backed by a transient in memory file system ( An example of the latter is the [annotation processor test framework|https://hickory.dev.java.net/nonav/apidocs/index.html?net/java/dev/hickory/testing/package-summary.html] in hickory)
    But probably of more interest to you, you don't need to because you can simply [get an InputStream|http://java.sun.com/javase/6/docs/api/javax/tools/FileObject.html#openInputStream()] from the FileObject returned from [filer.getResource(...)|http://java.sun.com/javase/6/docs/api/javax/annotation/processing/Filer.html#getResource(javax.tools.JavaFileManager.Location,%20java.lang.CharSequence,%20java.lang.CharSequence)] and read it.
    You might also find the [Compiler Tree API|http://java.sun.com/javase/6/docs/jdk/api/javac/tree/index.html] useful. The Compiler Tree API is available to annotation processors running in Oracle's (Sun's) javac, but not in other compilers (possibly limiting portability).
    With this API you can [convert |http://java.sun.com/javase/6/docs/jdk/api/javac/tree/com/sun/source/util/Trees.html#getPath(javax.lang.model.element.Element)] the Element representing the annotation to a Treepath then [get the leaf node|http://java.sun.com/javase/6/docs/jdk/api/javac/tree/com/sun/source/util/TreePath.html#getLeaf()] and from that tree [obtain its offsets|http://java.sun.com/javase/6/docs/jdk/api/javac/tree/com/sun/source/util/Trees.html#getSourcePositions()] within the source file.
    Bruce

  • Failed to compile J2EE source files

    Hi all, I'm learning J2EE these days. When I followed the tutorials on how to compile source files,
    eg. 1. In a terminal window, go to the j2eetutorial/examples directory.
    2. Type the following command:
    ant converter
    I got a message with title "16 bit MS-DOS Subsystem" and content
    "C:\WINDOWS\system32\ntvdm.exe
    Error while setting up environment for the application. Choose 'Close' to terminate the application."
    Could anyone tell me what's going on?
    Thanks very much

    The documentation on the javac command has information on the options it provides:
    [http://java.sun.com/javase/6/docs/technotes/tools/windows/javac.html]
    Otherwise you could use a tool like Ant to manage the build.

  • Error while compiling the ejb java source files.................

    hi,
    i am new to ejb.......
    i have got error while compiling the ejb java source files............
    while compiling..........of this three i ahve got err in ejb home interface....
    ejb remote interface - succeded
    ejb bean class - succeded
    ejb home interface - error
    the error..............is in the return type of the ejb create() method in ejb home interface(which is the type of remote interface).
    the error message is cannot resolve symbol

    Hi,
    thanks for ur reply .....
    i have done enough searching in all sites including sun forum but in vain
    i have pasted my error below...
    can u plz predict anything from it
    D:\>path=%path%;c:\j2sdk1.4.2_12\bin;
    D:\>set classpath=%classpath%;d:\Sun\AppServer\lib\j2ee.jar;
    D:\>javac d:\Librarys\Library.java
    D:\>javac d:\Librarys\LibraryBean.java
    D:\>javac d:\Librarys\LibraryHome.java
    d:\Librarys\LibraryHome.java:8: cannot resolve symbol
    symbol : class Library
    location: interface Librarys.LibraryHome
    public Library create(String id, String name, String address, String phoneNo
    ) throws RemoteException, CreateException;
    ^
    d:\Librarys\LibraryHome.java:9: cannot resolve symbol
    symbol : class Library
    location: interface Librarys.LibraryHome
    public Library findByPrimaryKey(String id) throws FinderException, RemoteExc
    eption;
    ^
    2 errors
    thanks in advance...

  • Windows Easy Transfer (WET) Issues with External Hard Drive - "Can't read from the source file or disk"

    I work for Office Depot, in the tech department. Basically, one of our associates was supposed to do a data backup, and re-install Windows 7, then transfer the files back. He used Windows Easy Transfer and compacted everything into a 163 GB file. 
    Now comes the hard part. When we try to put it back on his computer ((drag-and-drop to the desktop) which has been wiped back to factory settings using the recovery partition), it stops at 79.5 GB remaining (you know how it doesn't give you a % of completion,
    it just shows how many GB are remaining) and then says "Can't read from the source file or disk" and gives you an option to try again, or cancel. It gets hung up on the same point each time.
    Normally, this wouldn't be a huge issue, but the contents on the drive are his wife's architect blueprints and interior design stuff, along with wedding photos, etc, which are the only copies they have. On top of those, they have court documents and other
    important files that we are unable to access now.
    I wasn't involved with this transfer, so I'm trying to clean up the mess as best I can. I remembered that the customer's wife was Russian, and had some files typed with a Russian keyboard, so on and so forth. I wonder if that's the issue? If not, I really
    have no idea how to manually extract things from a ".mig" file, or how to diagnose what area is potentially corrupted.
    In light of this situation, we tried using "Recuva" to recover the files post-wipe, but everything was corrupted or unable to be opened, and it also extracted and recovered all of the "useless" photos, such as the skype logos, up and
    down arrows for browsers, etc (it was 160,000+ photos).
    Trying to avoid a potential lawsuit, unhappy customer, and costing the company lots of money to see if professionals can get into this external hard drive.
    Other relevant information:
    We used a Toshiba 500 GB (465 GB) external hard drive.
    Customer's computer is an HP Pavilion P6000 Series (Model No. p6520y) running Windows 7 Home Premium 64-bit Service Pack 1.
    Any other information that is needed can be provided, thanks in advance, and hopefully we can find a solution to this issue quickly!
    -John

    I think there's a lack of understanding somewhere.
    "If you even can't start the process, please unplug it from your new PC. Then head back to your new computer and plug
    the external drive back in to your new computer. "
    Unplug from new, head back to new, plug it back in? That doesn't make much sense! Haha.
    I knew what you meant though, somewhat. When I search through the drives after clicking yes (Has windows easy transfer
    already saved your files blah blah blah) I click on the transfer file and it says "Windows Easy Transfer could not open the file".
    Rather than drag-and-drop the file to the desktop, I now tried to double-click on the file itself while it was plugged
    into the computer. It opened, and it started transferring until it was about 70% completed, and then an error popped up saying "WET can't open the easy transfer file, make sure your USB device is plugged in or check your internet connection". 
    I checked, and the USB hard drive's light wasn't on. Now, I unplug it and plug it back in, and the light comes back on,
    so I click Retry, and it resets the bar back to nothing and says "Transfer time: 1 minute".
    Rather than continue trying, I clicked "Cancel" instead of Retry, and it says "Your transfer did not complete successfully."
    It says to click "view report" for more information, but there's no "view report button".
    At the moment, I am scanning the External Drive for bad sectors using the check disk tool in properties. It's frozen
    at "0 USN bytes processed".

Maybe you are looking for

  • I want to upgrade my OS from 10.6.8

    I have a macbook 4,1 late 2008 running osx 10.6.8. I want to upgrade my OS. Is it the only latest os i can use or can i upgrade to any other latest os than this??

  • How do I stop Pages 5.2.2 from opening on start up

    When I start up my MBP, Pages opens along with Safari.  It sits there in the Dock and does the "bounce" about 50 times driving me nuts.  How can i stop it from opening.  I can't find anyplace to do this in settings. Maverick 10.9.5

  • Perl module not working/installed properly

    I have a perl script that worked fine on Ubuntu.  I've now replaced Ubuntu with Arch and installed the perl modules I need to run this script and one of them doesn't seem to be working properly, I think I had a hiccup during installation of this part

  • HotSync Palm works, can't use iSync

    We can sync our old Palm m505 using HotSync 3.2.1 to Palm Desktop 4.2.1 with no problems. My daughter wants to sync instead with iCal, though. When we launch iSync 2.4 and select Devices, Enable Palm OS Syncing..., click Continue, it says the HotSync

  • Problem installing oracle 11 on ubuntu 12.10

    I successfully downloaded oracle 11 onto linux ubuntu 12.10, converted the .rpm package to a .deb package and completed the installation up to the point of entering the command "sqlplus sys as sysdba". In response I received the error message "ORA-12