Recommended Answers
Jump to Postto compile i believe you would run javac file.java and it should compile and to run it you would just use java file.class
and that should do it i believe :) you will have to locate these 2 files on your system javac and java i but not sure. this …
Jump to Postopen your command prompt.
Change your directory to wherever your programs are...
Eg if they are in C:\java, then:
cd c:\java ENTER
Then javac fileName.java ENTER
That line compiles it, and creates a .class file,
Next... to execute the program...
java fileName.java ENTERIf you used an IDE like …
Jump to PostI made a little error above,,,
you just need to do java fileName to execute.Ok, try this...
cd c:\java ENTER
SET CLASSPATH= ENTER
javac fileName.java ENTER
java fileName ENTERThat might work, but your JDK needs to be set up correctly, the command prompt needs to know …
Jump to Postgrii_19 do not use this approach, this is considered bad practice to save anything into Java instalation folder. Please follow the link to the tutorial which I gave it to you in another post
Jump to PostOh man, the deaf leading the blind.
I have no idea where this "save it to the bin folder" stuff got started, but here ye, what rubbish.
I know, I know, now you're going to come back with, but it works and its better than nothing, so whats …
All 24 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.