I’m a new coder. I keep getting this when running my program, nix error: building nix env: exit status 1, Output has been trimmed to the last 20 lines. I have no idea why and I’m coding in java. I would really appreciate if the help team could go in and look at my code for me to debug it.
Welcome to Ask! Could you please provide the link to your Repl so we can look at your code?
Hi, I’m still quite stuck on this. Any chance you could help figure out what the issue is?
Looking at your files and at the hidden file
.replit, I cannot find
Main.java, which is the file the Repl is attempting to run. If this file does not exist, this is a major problem. I cannot find any
There’s the missing main file, but also the replit.nix is not set up correctly. But since this looks like a school project I would ask your teacher to fix the Repl or have them get you a new template to work off of.
Thanks for checking that out. If that file doesn’t exist, can I just add it in and name it? Is it something that should’ve come with this project? Because I just opened the link from a Sophia course and so they had setup a file under my account so I could work on this particular project. I guess what are the next steps for me to have it run smoothly?
Could you link to the course?
When you hit run, the .replit in the hidden files does this:
compile = "javac -classpath .:target/dependency/* -d . $(find . -type f -name '*.java')"
run = "java -classpath .:target/dependency/* Main"
entrypoint = "Main.java"
hidden = ["**/*.class"]
If main.java isn’t there then it won’t run. It sounds like the course could be out of date.
For your nix error: run in Shell
sed -i 5,7d replit.nix
and in future make sure to watch out for whether text you entered is going into the Console/Shell instead of your files (i.e., the cursor in the Console/Shell is filled)
make sure that all files you want to run have a
.java extension and the class you want to run is called
Main and not
BlackJackSimulation (and so the file must also be called