#Code runs using IntelliJ but not in Visual Studio Code

9 messages · Page 1 of 1 (latest)

desert swan
#

I have a project me and my friends were working on. we initialized the project in Intellij using Gradle. when I try to run the program in vsc it gives an error. the cause of this error I believe is VSC cannot detect the resource folder where a part of the program needs to read to get input from. for some context here is the method:

public void importTOF(String filename) {
        try (Scanner fileReader = new Scanner(Paths.get("src/main/resources/"+filename))) {
            ArrayList<String> lines = new ArrayList<>();
            while (fileReader.hasNextLine()) {
                lines.add(fileReader.nextLine());
            }
  //the rest of the method
}

after tinkering around with the file location I found out that the project can run if I move the file into the /project-name/ directory. is there any way I can make vsc read the file in the src/main/resources directory?

silent falconBOT
#

This post has been reserved for your question.

Hey @desert swan! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

silent falconBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.

desert swan
#

Anyone?

sage junco
#

I mean, you could have shown the error.

But I expect nobody here uses vsc

silent falconBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.

desert swan
#

should have suggested them to use intellij smh