Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8204650

[Windows 10] javac won't compile, reports "not a file" for OneDrive on-demand source files

XMLWordPrintable

    • 9
    • x86_64
    • windows_10

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10. Fails on Java 9.0.1 and newer, not sure when it was introduced. No problem under Java 8.

      A DESCRIPTION OF THE PROBLEM :
      For java source files in a OneDrive folder with the On-Demand setting on (only available and the default on recent versions of Windows 10), javac will not compile the files, and reports "not a file".

      REGRESSION : Last worked in version 8u162

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Attempt to compile any Java file in a OneDrive folder with On-Demand turned on.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expect file to compile.
      ACTUAL -
      javac reports "not a file", does not compile. Here are results of a test with Java 9.0.1 and 1.8.0_161:

      C:\Users\larry\OneDrive>"C:\Program Files\Java\jdk-9.0.1\bin\javac" Test.java
      javac: not a file: Test.java
      Usage: javac <options> <source files>
      use --help for a list of possible options

      C:\Users\larry\OneDrive>"C:\Program Files\Java\jdk1.8.0_161\bin\javac" Test.java


      ---------- BEGIN SOURCE ----------
      public class Test {
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Turn off On-Demand in OneDrive settings or copy files in/out of a non-OneDrive folder to work with them.


      FREQUENCY : always


            jjg Jonathan Gibbons
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: