about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-01-25T19·39+0000
committerWilliam Carroll <wpcarro@gmail.com>2020-01-25T19·39+0000
commit5a2a1694e3790e97da5933ac66ff68fb3170c8f0 (patch)
treeb3138875ec6528b9c4e870395640e319129b967d
parent143fc970322237963d5358ae832fd18ea045d67a (diff)
Support java directory
Add an example of two java files, Main.java and Another.java, where Main.java
depends on Another.java. This is part of a larger example of attempting to use
Nix to package these.

Also ignoring the *.class files that `javac <filename>` outputs.
-rw-r--r--.gitignore1
-rw-r--r--java/Another.java5
-rw-r--r--java/Main.java6
3 files changed, 12 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 51eb9644acd7..12ecf28fd42f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@
 
 # Python
 __pycache__
+*.class
diff --git a/java/Another.java b/java/Another.java
new file mode 100644
index 000000000000..e431e157336b
--- /dev/null
+++ b/java/Another.java
@@ -0,0 +1,5 @@
+public class Another {
+  public static String whatis() {
+    return "Testing";
+  }
+}
diff --git a/java/Main.java b/java/Main.java
new file mode 100644
index 000000000000..0bfa9ebc2a34
--- /dev/null
+++ b/java/Main.java
@@ -0,0 +1,6 @@
+public class Main {
+  public static void main(String[] args) {
+    System.out.println(System.getProperty("java.class.path"));
+    System.out.println(Another.whatis());
+  }
+}