mirror of
https://github.com/maaslalani/slides.git
synced 2026-01-09 14:28:05 -05:00
feat: add support for java code execution
As of Java 11 a single file can be launched without explicitly compiling, packaging and running the file in different steps. In other words single-file source-code programs can be executed with "java Program.java", where "Program.java" is the name of the file to be executed.
This commit is contained in:
committed by
Maas Lalani
parent
0572aaac99
commit
ebc2ab70bf
@@ -16,6 +16,7 @@ Currently supported languages:
|
||||
* `ruby`
|
||||
* `perl`
|
||||
* `rust`
|
||||
* `java`
|
||||
<!-- * `secret` -->
|
||||
|
||||
---
|
||||
@@ -105,3 +106,14 @@ fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Java
|
||||
```java
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello, world!");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -25,6 +25,7 @@ const (
|
||||
Python = "python"
|
||||
Ruby = "ruby"
|
||||
Rust = "rust"
|
||||
Java = "java"
|
||||
)
|
||||
|
||||
// Languages is a map of supported languages with their extensions and commands
|
||||
@@ -71,4 +72,8 @@ var Languages = map[string]Language{
|
||||
{"<path>/<name>.run"},
|
||||
},
|
||||
},
|
||||
Java: {
|
||||
Extension: "java",
|
||||
Commands: cmds{{"java", "<file>"}},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user