Github with repl.it

Hello-can anyone explain this in repl.it. I have connected a classroom with Github and cannot run therepo. I do not understand what the below statement means.
Thanks so much

‘run’ isn’t configured in the .replit file
try adding ‘run = “echo hello word”’ to .replit

When you set up an assignment to work with repl.it, GitHub Classroom will automatically create a .replit file when students create the assignment. While setting up the assignment, there’s a place to set what clicking the run button in repl.it will do, as well as what language it will be set to. This can also be done manually. Here’s an example of my .replit file:

language = “python3”
run = “python3 hello_world.py”

Hello-
Thanks for your reply but I am not sure of your response. The language is already set to java. Below is a shot of what I see. Zero clue as to what I would put. Does the picture help? Thanks

Create a file in your repo and call it “.replit”. In that file have 2 lines:

language = "java"
run = "javac YourFile.java; java YourFile"

where you replace YourFIle with the name of your java file you want to compile and run.

I know I am a pain but zero clue as to how these function together. If you could send an example repl.it It would be really helpful so I can see the file structure. Thai sis what I am getting now.
Thanks

Wow-thank you. Mine looks nothing like that even through I have connected GitHub. I am trying to run it solely from the browser. Thank you

I add two files in the root directory in order to open GitHub repos successfully in Repl.it. They are called .replit and main.sh and they look like this: .

.replit file

run = ‘sh main.sh’

main.sh file

cd ‘Concentration’/src //Concentration is folder name
*javac .java
java PlayGame //PlayGame is the Java class containing the main method

1 Like

Hello-
Thank you for your file. I have tried to copy it and am still getting an error. Do you see anything that I am doing wrong? Two screenshots are coming but I can only send one at a time.
Thanks so much

Looks like it doesn like “java10”, try just using “java” instead in your run command.

Thank you!!! You are a lifesaver! I am so appreciative of your help! :clap::joy::clap:
One more question-actually 2
So after I create the starter code and the repository, the students need to create the java file in repl themselves?

Also, have you used the autograder with repl? Do you like it?
Thank you so much again!

You can have the student create the file or provide a template file in the repo that students are supposed to edit. I switch between both methods, providing pseudocode in templates and requiring students to do things from scratch. If you have students make the file, be sure to specify exactly what the file should be named if you want to use autograding.

I created my own autograder last 2 years ago, but have switched to use autoagrading though GitHub actions that run my testing file. Before I had to give additional instructions to student about how to test their files, but now all they need to do is commit & push and the tests run automatically. This has the additional benefit of testing logs, so I can see the error messages without needing to clone and run the tests on my machine and answer questions that much quicker in an online environment. It also forces my students to commit more often so I can see their work which helps prevent cheating.

Ok-lots of excellent info. I’m going to work on autograding next.
Thanks again-

Hello-
Me again. Please ignore me if you want. I just have no one to work with on this in my school. I am practicing and getting this error. Everything seems to be lined up correctly. ANy thoughts?
Thanks so much!
https://repl.it/@ELIZABETHTHOMAS/FinalWelcome-1#FinalWelcome.java

The link is giving me a 404, is the repl set to private?

Hello-
So sorry for the delay getting this back. It was private!
Thank you!
https://repl.it/join/gsqtltid-elizabeththomas

You need to compile java code into a class file before you can run it. Change your run command to:

run = "javac FinalWelcome.java; java FinalWelcome" 

You’ll also need a newline between your comment and the println for it to compile. It looks like I could make the changes on repl, so I did. Program compiles and runs now.