Beta8397 / virtual_robot

A 2D robot simulator to help beginners learn Java programming for FTC Robotics
100 stars 171 forks source link

Can't load process #72

Closed AB027897 closed 3 years ago

AB027897 commented 3 years ago

It is giving me this error: Error running 'Main': Cannot start process, the working directory 'C:\Users\Guest\Downloads\virtual_robot-master\virtual_robot\Controller\src\virtual_robot\config' does not exist

I have everything configured properly including the JDK. I'm using IntelliJ.

jkenney2 commented 3 years ago

I haven't seen that error before. I will try to help.

What is the path you are pointing to when you open the project (e.g., "C:\Users\Guest\Downloads\virtual_robot-master\virtual_robot-master")? Is it the folder that contains subfolders named "Controller", "TeamCode", ".idea", and "lib"?

Are you using a recent version of IntelliJ?

If you click the down-arrow next to "Main" (to the left of the green run arrowhead) and select "Edit Configurations...", what is shown in the window that opens in the "Working Directory" box?

jkenney2 commented 3 years ago

@AB027897 If you have downloaded the zip from the github site, then extracted it to some directory ("Extract_Directory"), your path structure should look like this:

C:\ ... \Extract_Directory\virtual_robot-master

So for example, when I just accept defaults, my "Extract_Directory" is virtual_robot-master, and the root file of the project, also named virtual_robot-master, is nested within that. So the path structure I get is:

C:\Users\JimLori\Downloads\virtual_robot-master\virtual_robot-master

When opening the project in IntelliJ, you would point to the inner (nested) virtual_robot-master folder (the project root folder). Then, you should have a run configuration named "Main". If you click the down arrow next to Main, and edit the configuration, you can see what the working directory is set to. The working directory should be set to your project root folder, i.e., the inner (nested) virtual_robot-master folder. I'm not sure why, but I'm guessing this is somehow set wrong. When I go in and change this to a folder that doesn't exist, I get the same error message you have. It is easy to change it to the correct folder.

Let me know whether this fixes it.

AB027897 commented 3 years ago

I figured it would be something related to the working directory. However, my working directory is the same as yours. I think it has something to do with the main class: virtual_robot-master.virtual_robot-master.Controller.src.virtual_robot.config. The screenshot below will show you my configuration. Configuration

jkenney2 commented 3 years ago

Here is a screenshot of my edit configurations window:

image

It looks like there might be an error in the path to your main class (VirtualRobotApplication). You don't need the full path starting from 'C:\', just the part that comes after the src folder in the Controller module:

virtual_robot.controller.VirtualRobotApplication

AB027897 commented 3 years ago

I did it and now its giving me a different error. Error: Could not find or load main class virtual_robot.controller.VirtualRobotApplication. I didn't delete any of the files so thats very wierd

jkenney2 commented 3 years ago

I was able to reproduce that error message by doing the following:

In the 'Edit Configurations' dialog, click "Modify Options", and select "Do not build before run". I then also deleted the "out" directory from the project root (since that contains the compiled classes). Then I tried to run it. It has the VirtualRobotApplication.java file, but isn't compiling it, and doesn't have access to an already-compiled class. Any chance you have this option selected?

AB027897 commented 3 years ago

I don't have the "Do not build before run" selected, but I forgot the "out" from the directory. However, it is still giving me the same error.

jkenney2 commented 3 years ago

I'm running out of ideas. If you'd like, you can upload your version of the project to google drive or something similar and share a link so I can look at it; if you do that, send the link to our team email (ftc8397@gmail.com).

You could also try re-downloading and re-extracting the project.

AB027897 commented 3 years ago

Alright I'm going to send you screenshots of the project structure and the configuration. Configuration Simulater Troubleshoot

jkenney2 commented 3 years ago

I noticed under 'Build and Run' in the config editor, you have "Java 8 SDK of 'virtual ...'". The module containing the main class is the "Controller" module. Try clicking "Modify Options" -> "Use Class Path of" -> Controller.