- 1
Where to write Javac ExampleProgram.java
Where do I write that to compile it's?
5 ответов
+ 2
First of All you need to configure JDK
1.Download and Install JDK Source here: http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html
2.Go to your Computer properties
3.Advanced System Settings
4.Environment Variables
5.and ADD a new Path
6.variable name ; PATH
7.variable value go to your disk C or D whenever you have installed java / program files / java / jdk(with following version) / bin
8.a Copy the addres and paste it to your value
its should look something like this
C:\Program Files\Java\jdk1.8.0_101\bin
9.click okay
after you have done the java configuration open cmd and type java hit enter if it doesn't recognise the command you have done any mistake in configuration otherwise it will show a bunch of other commands.
How to compile a program ?
so when we first start the cmd the cmd is at default your User directory so you need to go to desktop there where your java file is then you need to type
"cd Desktop " and then javac FileName.java and for running java and just Filename without extension.
+ 1
Console, on the same path as the file.
+ 1
So I kinda was being stupid was supposed to put it into command prompt but how do I get to the directory inside the command prompt?
0
Dang you got that a little too late I just figured it out the hard way XD
- 1
You will write it on cmd( Command promt). A short way to open it is: Open the folder your java files located -> Right-click on address bar -> Type cmd on it -> Type javac command.