Skip to content

Instantly share code, notes, and snippets.

public class HelloWorld {
public static void main(String[] args) {
// Prints "Hello, World" to the terminal window.
System.out.println("Hello, World");
}
}

Something like:

$ # cleanish 18.04 WSL install from the MSFT Store running on Win10 1809
$ curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
$ sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
$ sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
$ sudo apt update && sudo apt upgrade
$ sudo apt install libgtk2.0-0 libxss1 libasound2 mesa-utils code
$ export DISPLAY=localhost:0
$ export NO_AT_BRIDGE=1
#include <stdio.h>
int main()
{
printf("hello world\n");
return 0;
}
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
12774 execve("./a.out", ["./a.out"], 0x7ffd45065198 /* 53 vars */) = 0
12774 brk(NULL) = 0x123d000
12774 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
12774 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
12774 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
12774 fstat(3, {st_mode=S_IFREG|0644, st_size=116046, ...}) = 0
12774 mmap(NULL, 116046, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f0231f58000
12774 close(3) = 0
12774 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
12774 openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3
1388 execve("./a.out", ["./a.out"], 0x7ffff38b16d8 /* 18 vars */) = 0
1388 brk(NULL) = 0x2e88000
1388 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
1388 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
1388 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
1388 fstat(3, {st_mode=S_IFREG|0644, st_size=58955, ...}) = 0
1388 mmap(NULL, 58955, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f48ddb31000
1388 close(3) = 0
1388 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
1388 openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3
execve("./a.out", ["./a.out"], [/* 23 vars */]) = 0
brk(NULL) = 0x22e7000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=48998, ...}) = 0
mmap(NULL, 48998, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5a9511e000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
# build static bsdtar linked against musl in Ubuntu 16.04 on WSL
mkdir bsdtarbuild && cd bsdtarbuild
sudo su
ALPINE_MIRROR=http://dl-cdn.alpinelinux.org/alpine
mkdir alpine-root
ALPINE_ROOT=$PWD/alpine-root
ALPINE_APKTOOLS=apk-tools-static-2.9.1-r0.apk # note this is a moving target
wget -q $ALPINE_MIRROR/latest-stable/main/x86_64/$ALPINE_APKTOOLS
tar xf $ALPINE_APKTOOLS
This file has been truncated, but you can view the full file.
867 execve("/usr/lib/snapd/snapd", ["/usr/lib/snapd/snapd"], [/* 14 vars */]) = 0
867 brk(NULL) = 0x7ffff19d1000
867 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
867 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
867 open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
867 fstat(3, {st_mode=S_IFREG|0644, st_size=57421, ...}) = 0
867 mmap(NULL, 57421, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f327ecc7000
867 close(3) = 0
867 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
867 open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3