algs4 使用 DrJava 编写 Hello World on Windows

前阶段读了 Yinwang 的博客, 对 Scheme and Lisp 产生了很大的兴趣, 用 学生模式的  DrRacket IDE一步一步开始实现 How to Design Programs。

想到之前搁浅的 用 Atom 学习 Algs4 刷 LeetCode 计划, 索性 也用 对学生友好的 DrJava 重新开始。

参考 https://algs4.cs.princeton.edu/windows/

 详细描述了搭建 algs4 学生环境。

This document instructs you on how to set up our Java programming environment for your Windows computer.
It also provides a step-by-step guide for creating, compiling, and executing your first Java program using either DrJava or the Command Prompt.
All of the software used is freely available. These instructions apply to
32-bit and 64-bit Windows 8, Windows 7, Vista SP1, and XP SP3.
  • 0.   Install the Programming Environment

     下载地址: https://algs4.cs.princeton.edu/windows/algs4.exe

     产生如下图日志: 详细 https://algs4.cs.princeton.edu/windows/log.txt

         

       完成之后:

          

     看到这个图片,之后删除 algs4.exe.

     

  • 1.   Create the Program in DrJava

   

/******************************************************************************
 *  Compilation:  javac HelloWorld.java
 *  Execution:    java HelloWorld
 *
 *  Prints "Hello, World". By tradition, this is everyone's first program.
 *
 *  % java HelloWorld
 *  Hello, World
 *
 *  These 17 lines of text are comments. They are not part of the program;
 *  they serve to remind us about its properties. The first two lines tell
 *  us what to type to compile and test the program. The next line describes
 *  the purpose of the program. The next few lines give a sample execution
 *  of the program and the resulting output. We will always include such 
 *  lines in our programs and encourage you to do the same.
 *
 ******************************************************************************/

public class HelloWorld {

    public static void main(String[] args) {
        // Prints "Hello, World" to the terminal window.
        System.out.println("Hello, World");
    }

}

 

 compile -> 报错 -》 好吧 终结 

 

转载于:https://www.cnblogs.com/heart-king/p/9151476.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值