Hello, I am currently trying to submit my project on Replit. The problem is, we can’t use “Run”, button so we have to compile it in Shell console. I tried to compile javac filename.java And then java filename
It keeps giving me error, error: file not found: SophiaProjectRukhasar.java
Usage: javac
use --help for a list of possible options
My class name is same as file name.
I really need to submit this,I use other IDEs and code runs perfectly fine.
Can someone please assist, I have to use Replit for coursework project?
Hello, it seems like the file you want to compile is inside a folder, so it is not being found. (The commands only search for the specified file in the current working directory, the top level files, I believe.)
Try right clicking the file you want to compile, and click Copy file path, then use that in your Shell command. (Paste with Ctrl+Shift+v)
Hi @solutionszilla , welcome to the forums!
Either run your code in the Main.java file provided and revert your .replit back to its original state, or:
Move the file out of the folders into the root.
Change the entrypoint to whatever file you would like to run.
Run the repl.
Or, enter java filename.java in the Shell to see the output there, where you’ll need to chamge filename the the actual name of the file.
I really wish, I can screenshare with someone and resolve this. Since the institute only use Replit, I am literally stuck on this project. It’s still giving me error.
While compiling, I get this error now: java SophiaPrerror: Class names, ‘java.SophiaProjectRukhasar’, are only accepted if annotation processing is explicitly requested
1 error
Try forking the repl and follow the steps I showed. In the repl, the src directory is removed, and the file is called test.py. You can write the code inside there and run it.
If you want to rename the file, rename it, then change the entrypoint in the .replit file to the new filename (don’t change anything else).
Or, run java filename.java, where filename is the name of the file you want to run.
I followed your instruction, I still get this error https://replit.com/@solutionszilla/project7
Can you please assist further.
I attached the link as well. I just need this project to compile and run, so my project can be submitted. I am a beginner learning Java, and I am so tired with this error. It’s been 3 days now.