https://github.com/sparkoo/java9-demos
https://github.com/sparkoo/java9-demos
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sparkoo/java9-demos
- Owner: sparkoo
- Created: 2017-01-06T13:45:27.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-25T14:27:14.000Z (over 8 years ago)
- Last Synced: 2025-01-11T06:10:20.233Z (4 months ago)
- Language: Java
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# java9-demos
Demos of new Java9 features.
### setup
Check `j8.sh` and `j9.sh` and set correct `JAVA_HOME` paths### run
#### demos without modules (classpath)
To run individual demo, enter directory and run `../buildj8.sh` or `../buildj9.sh````
mvala[~/dev/devconf/demos] λ cd d03_anonymousClassDiamond/
mvala[~/dev/devconf/demos/d03_anonymousClassDiamond] λ sh ../buildj8.sh
src/Main.java:7: error: cannot infer type arguments for Iface
anonymous = new Iface<>() {
^
reason: cannot use '<>' with anonymous inner classes
where T is a type-variable:
T extends Object declared in interface Iface
1 error
Error: Could not find or load main class Main
mvala[~/dev/devconf/demos/d03_anonymousClassDiamond] λ sh ../buildj9.sh
not set yet
Hello
```#### demos with modules (modulepath)
To run module demos, enter directory and run `../j9mod.sh`
```
mvala[~/dev/devconf/demos] λ cd d12_moduleCycleDeps/
mvala[~/dev/devconf/demos/d12_moduleCycleDeps] λ sh ../j9mod.sh
build .......... ./src/moduleB/module-info.java:2: error: cyclic dependence involving moduleA
requires moduleA;
^
1 error
fail
```