Iyke
Iyke

Reputation: 47

How do I resolve fileNotFoundException in Java using Intellij

My project on Intellij does not run my project any more, it keeps throwing some compilation errors.

I have tried Rebuilding, Building and also Invalidate Cache/Restarted but I didn't work I also checked out this link below, but it didn't work for me:

https://intellij-support.jetbrains.com/hc/en-us/community/posts/206885455-java-Cannot-find-JDK-1-7-for-module

I keep getting this error

java.io.FileNotFoundException: /home/byteworks/Documents/Projects/ics-assessment-api/ics-assessment-controller/out/production/resources/customers-template/AGENCY_CUSTOMER_MASTERLIST_TAXPAYER v1.0.xlsx (Permission denied)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(FileOutputStream.java:270)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
    at com.intellij.openapi.util.io.FileUtil.openOutputStream(FileUtil.java:492)
    at com.intellij.openapi.util.io.FileUtil.performCopy(FileUtil.java:452)
    at com.intellij.openapi.util.io.FileUtil.copyContent(FileUtil.java:447)
    at org.jetbrains.jps.incremental.FSOperations.copy(FSOperations.java:437)
    at org.jetbrains.jps.gradle.compiler.GradleResourceFileProcessor.copyFile(GradleResourceFileProcessor.java:68)
    at org.jetbrains.jps.gradle.compiler.GradleResourcesBuilder.build(GradleResourcesBuilder.java:101)
    at org.jetbrains.jps.gradle.compiler.GradleResourcesBuilder.build(GradleResourcesBuilder.java:28)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildTarget(IncProjectBuilder.java:1037)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:1018)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1074)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:968)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:797)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:375)
    at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:178)
    at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:138)
    at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:302)
    at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:135)
    at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:229)
    at org.jetbrains.jps.service.impl.SharedThreadPoolImpl.lambda$executeOnPooledThread$0(SharedThreadPoolImpl.java:42)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Please perform full project rebuild (Build | Rebuild Project)```

Upvotes: 0

Views: 1808

Answers (1)

Theresa Forster
Theresa Forster

Reputation: 1932

As someone else has said it is saying permission denied, Has the folder or file been moved or altered by some form of protection / anti virus?

The error appears to be where it is trying to copy the file from /home/byteworks/Documents/Projects/ics-assessment-api/ics-assessment-controller/out/production/resources/customers-template/AGENCY_CUSTOMER_MASTERLIST_TAXPAYER v1.0.xlsx

Is that still the path where that xlsx is ? also shouldnt it be xslx.

Could that be the problem you have a typo in the filename in the build.gradle copy command? looks like you are on some form of linux computer as you have a /home/byteworks folder, are you the user byteworks? if not do you have permission to access the byteworks folder as Users can restrict access to their Documents folder. check the file owner and permissions if you do an ls -la in the folder then you can see the flags, _rwxrwxrwx - The flags are _ = the SetUUID/SetGroup/Sticky flag rwx - owner permissions Read Write Execute (Execute is also ls view permission on folders) rwx - group permissions rwx - other permissions - if the last one is ___ that means anyone who isn't the owner doesn't have permission to access the file.

Upvotes: 1

Related Questions