---
title: "如何在cmd命令模式下compile java"
author: "danielhjd"
date: "2011-06-29T11:34:32Z"
tags: []
categories: ["编程语言"]
slug: "cmd-compile-java"
draft: false
lastmod: "2011-06-29T11:34:32Z"
id: 1109225
url: "https://danielhjd.iteye.com/blog/1109225"
---

Step one: Run cmd

![](http://dl.iteye.com/upload/attachment/506787/c1e57412-ed88-39f9-9741-4bc52b59d31d.jpg)  
 

Step two: change directory to ''e:'' where have jave file

c:\\Documents and Settings\\Administrator&gt;e:  
![](http://dl.iteye.com/upload/attachment/506789/283839aa-a8e9-3665-9cc9-3796e21ebd1d.jpg)  
 

Step three: change directory to where you save the java File

E:\\&gt;cd workspace\\Algorithm\\src\\Daniel

E:\\workspace\\Algorithm\\src\\Daniel

 

***Highlight: "\\" is instead of "/", Here you should use the KEY WORD "cd"***

![](http://dl.iteye.com/upload/attachment/506791/823aa9d5-5169-3f1b-a9f4-a0ff9fabd907.jpg)  
 

**Step four: Use javac to compile xxx.java,and then there is one new file  xxx.class that created by**

**Javac ExhaustExample.java**

![](http://dl.iteye.com/upload/attachment/506798/01c95721-28b0-31b8-b935-51b23e5e5768.jpg)  
   
![](http://dl.iteye.com/upload/attachment/506800/da04cef0-2c34-3ab7-85eb-bdac4b372ac6.png)  
 Step five: use java to compile/run the programming

Java ExhaustExample