Skip to content
Snippets Groups Projects
Commit 0687c963 authored by Chao Zhan's avatar Chao Zhan
Browse files

update slides

parent 6067cb7e
Branches
No related tags found
No related merge requests found
.idea
*.iml
node_modules node_modules
compile_flags.txt compile_flags.txt
...@@ -65,10 +65,54 @@ title: Java Dev Environment Setup ...@@ -65,10 +65,54 @@ title: Java Dev Environment Setup
layout: center layout: center
--- ---
### Java Dev Environment Setup # Java Dev Environment Setup
<br/> <br/>
- Using an IDE is recommended: [IntelliJ IDEA](https://www.jetbrains.com/idea/download/), [Eclipse](https://www.eclipse.org/downloads/) - Using an IDE is recommended: [IntelliJ IDEA](https://www.jetbrains.com/idea/download/), [Eclipse](https://www.eclipse.org/downloads/)
- Install JDK: [Oracle JDK 17](https://docs.oracle.com/en/java/javase/17/install/overview-jdk-installation.html#GUID-8677A77F-231A-40F7-98B9-1FD0B48C346A) (same version on Andorra) - Install JDK: [Oracle JDK 17](https://docs.oracle.com/en/java/javase/17/install/overview-jdk-installation.html#GUID-8677A77F-231A-40F7-98B9-1FD0B48C346A) (same version on Andorra)
- Use [Gradle](https://gradle.org/) for building and running your project, or use the IDE's built-in tools - Use [Gradle](https://gradle.org/) for building and running your project, or use the IDE's built-in tools
- Use [Package Search](https://package-search.jetbrains.com/) to find your java libraries
---
title: Gradle I
---
# Gradle
- Gradle is an open-source build automation tool focused on flexibility and performance.
- Gradle build scripts are written using a **Groovy** or **Kotlin** DSL.
- Check out the [Installation Guide](https://docs.gradle.org/current/userguide/installation.html)
- `build.gradle/build.gradle.kts` is the main configuration file for a Gradle project
- `gradlew` is the Gradle wrapper script, which is used to execute Gradle tasks for Linux or MacOS
- `gradlew.bat` is the Gradle wrapper script for Windows
---
title: Gradle II
---
## Write a Task in Gradle Build Script
Write a task in gradle build script to run java program.
```kotlin
tasks.register<JavaExec>("<task-name>") {
// if your program needs input from stdin
standardInput = System.`in`
// Set the main class to be executed
mainClass.set("<main-class>")
// Set classpath dependencies if needed
classpath = sourceSets.main.get().runtimeClasspath
// Set JVM arguments if needed
// jvmArgs = listOf("-Xmx512m")
// Set program arguments if needed
// args = listOf("arg1", "arg2")
}
```
See live demo in the tutorial.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment