Beginner - Can't get HelloWorld to work, says it "does not exist” [SOLVED]

Answered

Hi - I've been using Eclipse for class and I'd like to switch over to IntelliJ. However I can't even get a basic program working!

I did the basic new Java project setup. It's true that this path (for output?) does not exist, but I don't want to have to go and create new folders for every single project - is that necessary for IntelliJ? Is there some way to set it to read from a different path? There is definitely a Hello.java file in the src folder. 

Does setting up an IDE ever get any easier I just wanna get my work done and this is taking so long. :(

 

0
10 comments

To start the program in Java it has to be compiled at first. You don't have to manually create the output directory, but instead please try using `Build | Build Project` action from the IDE main menu. Please see https://www.jetbrains.com/help/idea/compiling-applications.html#compile_module

I'd also recommend you to follow this guide about creating a simple Java application in IntelliJ https://www.jetbrains.com/help/idea/creating-and-running-your-first-java-application.html to get familiar with a workflow

0

I assure you I have re-built it again and again and carefully inspected the first application guide, but it is extremely generic. The issue occurs at build (and re-build), and seems to be that IntelliJ not automatically creating subdirectories for sources. I'm not sure why that is or how to correct it. I do not want to have to manually build (or set) these subdirectories every time I create a new project. 

Even after manually setting project compiler output and module compiler output paths to a directory I KNOW exists I am still being told it “does not exist”. 

Any advice?

 

0

I tried reinstalling and running the basic built-in tutorial and even that isn't running properly. 

0

Hello,

Could you please attach logs folder zipped (https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files) after running “Build | Build Project” to check if there are any errors during build? You may share large files via https://uploads.jetbrains.com/ form. Please provide uploadID afterwards.

0

we figured it out! turns out it had to do with an exclamation point in the username, and projects can run fine outside of the Users folder. Pretty freaky. 

0

I couldn't reproduce the issue with exclamation mark in path. Is it possible to share logs to check what is wrong there?

0

Oh, weird. Sure thing, here's the upload ID: 2024_10_07_o9cqHG44CqhxdKXBCkHESE

Would love to know what you find in there. 

I can say looking at the error now it did add a slash before the exclamation point - “b\!\” while the actual user folder is “b!”. So if you created a folder that's just titled with an exclamation mark it might not replicate correctly. I'm assuming it adds a slash before ! which… sort of make sense with computer logic at least? 

0

Thanks for clarification. IDE escapes the exclamation mark, so compiled files are located under different location. It still works fine if IDE could create separate “!” folder. But in your case output folder couldn't be created or read, so error was shown.

0

I can compile java projects just fine in that sub folder with Eclipse, though. So it is something with IntelliJ specifically. Anyway thanks for everybody’s help! 

0

I suppose Eclipse doesn't escape exclamation mark, so path is not changed. We'll check it on our side and provide a fix.

0

Please sign in to leave a comment.