Last active
March 22, 2018 01:20
-
-
Save null-dev/22132dcba77dfc827061480be86b9be2 to your computer and use it in GitHub Desktop.
Script to write, compile and run simple multidimensional array test cases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Disable WINE debug logging | |
export WINEDEBUG=-all | |
cat <<EOM >HelloWorld.java | |
class HelloWorld { | |
public static void main(String[] args) { | |
int[][] yesArraysWork = new int[10][10]; | |
Integer[] sameAsObjArrays = new Integer[10]; | |
System.out.println("Hello, world (from Java 1.1.8_010)!"); | |
} | |
} | |
EOM | |
cat <<EOM >Main.java | |
import java.util.Date; | |
class Main { | |
public static void main(String[] args) { | |
Integer[] multiDimTest = new Integer[10]; | |
System.out.println("Does not compile :( " + multiDimTest[1][1]); | |
Date[] manyDates = new Date[10]; | |
System.out.println("Many dates, but still can't get second dimension" + manyDates[1][1]); | |
} | |
} | |
EOM | |
set -x | |
wine bin/java.exe -version | |
wine bin/javac.exe HelloWorld.java | |
wine bin/java.exe HelloWorld | |
wine bin/javac.exe Main.java | |
wine bin/java.exe Main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment