Questions tagged [nosuchfileexception]

Checked exception thrown when an attempt is made to access a file that does not exist.

This checked exception is part of the new Java file API known as JSR 203 or NIO.2 introduced in Java 7. The exception thrown when an attempt is made to access a file that does not exist.

Oracle Documentation

Open JDK

73 questions
6
votes
0 answers

File.exists() works but Files.readAllBytes() fails with NoSuchFileException

I am trying to read a text file in Java and I get NoSuchFileException. I tried to check if the file path exists and it returns true. Here is my code. final File actualFile = new File(filePath); if (actualFile.exists()) { …
SyncMaster
  • 9,754
  • 34
  • 94
  • 137
6
votes
1 answer

Getting java.nio.file.NoSuchFileException from Files.move in Batch app

Background This is a multi-threaded batch application, each thread has it's own file. I have logic elsewhere that will stop the file rename from happening in the case of a file creation failure. This process runs as a daemon and generates a few…
Josh White
  • 194
  • 1
  • 8
6
votes
2 answers

Cygwin /cygdrive/c no such file or directory

Host system: Windows Server 2008 32-bit Installed: Cygwin I don't know when this problem started, but one of my Rails gems uses the command which to determine the location of a system-installed executable. In my circumstance, it returns…
5
votes
1 answer

Files.copy throws java.nio.file.NoSuchFileException even though the file to be copied definitely exists

I have a problem with a seemingly simple application. What it should do: -Read out the files (*.jpg) of a (hardcoded) directory -Use the contained Metadata (gotten via implemented Libraries) of said jpgs to generate directories (./year/month/) -copy…
user3026231
  • 51
  • 1
  • 2
4
votes
2 answers

Java isn't getting the file in the source code when compiled

Recently I have an issue with Java. I've tried some things I found on the web but they haven't worked, so I need help. I have a Java project in Eclipse. My main class is in src/programCode/UI_Main2.java. In that .java I try to access to a file in…
eric.m
  • 1,577
  • 10
  • 20
3
votes
2 answers

Not able to load file from Maven resources with Paths.get()

I apologize for this seemingly easy and almost a stupid question, but I have spent a lot of time to fix it without much success. I created a very simple maven project and then a simple text file inside the src/resources folder like this. pom.xml…
RDM
  • 1,136
  • 3
  • 28
  • 50
2
votes
2 answers

Verifying the existence of a file in the terminal

I am copying some code from GitHub, but when I try accessing a file within, the terminal outputs "No such file or directory". I've tried looking for the files manually on the computer but indeed I cannot find them. My guess is that the cloning is…
2
votes
1 answer

Jenkins throws NoSuchFileException when file exists in workspace

I have a method call which reads and returns the contents of a file, which works fine on my local box - Windows Server 2016, but when it runs on my Jenkins server - also living on a Windows Server box, it throws an error that it seemingly can't find…
Ben
  • 311
  • 2
  • 6
2
votes
1 answer

FileHandler creation gives NoSuchFileException cause missing .lck

im searching for 2 hours now fo a solution to this: Im trying to add a FileHandler to a Logger in a JAR. The Log-Directory is outside. In my IDE (NetBeans) this works: public static void addFileHandler(Logger logger) { try { Path…
Schesam
  • 583
  • 5
  • 19
2
votes
1 answer

I got a fatal error message when I tried to install the "v4l2capture" package in Python 3

I'm using Python 3.6 and after I tried to install the v4l2capture package, I got the following error message: "v4l2capture.c:20:10: fatal error: libv4l2.h: No such file or directory" Why is this and how do I solve it?
2
votes
1 answer

NoSuchFileException when using java.nio.file.Files.createTempDirectory

I have an issue when trying to create a temporary directory with java.nio.file.Files.createTempDirectory. I keep getting NoSuchFileException when trying to create the directory. Here is my code: import java.nio.file.Files; import…
Maaka
  • 35
  • 1
  • 1
  • 4
2
votes
2 answers

Pylatex error when generate PDF file - No such file or directory

I just want to use Pylatex to generate the pdf file. I look at the basic example and re-run the script but it raised the error: OSError: [Errno 2] No such file or directory. Here is my script: import sys from pylatex import Document, Section,…
Blurie
  • 148
  • 1
  • 2
  • 13
2
votes
1 answer

File Exception Handling and wait for a process in SWI Prolog

I am running my code on SWI Prolog and Windows 7. In my code, I call another application using 'win_exec()' (I tried using the method 'shell()', but it won't work.), and at the end produces its output in a text file. However sometimes it runs for…
shujin
  • 181
  • 12
2
votes
2 answers

NoSuchFileException in .jar but not in Eclipse

When i compile and run my program in Eclipse, is runs without exceptions. But when i export it to an runnable jar or an normal jar it does not find my settings file. My path is: String path= "src/settings/settings.ini"; In eclipse it runs without…
Pim_D
  • 89
  • 1
  • 10
1
vote
1 answer

Unable to start apache webserver due to ld.so.1: httpd: libonssys.so: open failed

When I do the below I'm able to start and stop apache instance alright $ sudo -u wsadm -I -H $ cd /web/apps/perf/apache/2.4.41/https-harsh/bin $ ./apachectl -k start However, when I ssh directly to the destination host using wsadm user and try to…
Ashar
  • 2,942
  • 10
  • 58
  • 122
1
2 3 4 5