Skip to content

Instantly share code, notes, and snippets.

@null-dev
Last active March 22, 2018 01:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save null-dev/22132dcba77dfc827061480be86b9be2 to your computer and use it in GitHub Desktop.
Save null-dev/22132dcba77dfc827061480be86b9be2 to your computer and use it in GitHub Desktop.
Script to write, compile and run simple multidimensional array test cases
#!/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