Can someone help me switch the package of my code in VSCODE/Java?

I am able to upload my new code ut driver station says “No robot code” but my old code runs just fine. The only difference I can see is the package. The new code says “package frc.robot;” and the old working code says “package org.usfirst.frc.team6000.robot;” I need to be able to add .subsystems or .commands to the end as well. I apologize for the beginner question. I am new to Java, VSCode, and WPILIB.

There are many possible reasons to this. One reason is, your code is crashing. In the driver station, click the gear then view console. You can see if there are errors in there.

Another thing is that the main class may not be specified correctly. You can check the build.gradle and make sure it has the correct main class.

With the different package name, you will still be able to add classes I to the commands and subsystems packages. Just create the directory, then create that class.

Did you use gradle to deploy the code? make sure the package is in this format to fit gradle:


And in your build.gradle file make sure your main class points to org.usfirst.frc.team6000.robot.Main

You can check examples here.

I moved my java files to my old project so that they would be in the src/
org.usfirst.frc.team6000.robot/ folder but how would I go about making a project that was formatted this way in the future? Before the folder was called “robot” instead of “org.usfirst.frc.team6000.robot” and I don’t know how to switch it or make it that way in the first place.

Thats not how java packages work in terms of folder structures. Your class would need to be in src/main/java/org/usfirst/frc/team6000/robot.

You are right that is how the folders are situated. How do I set up a project to be in that format?