Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/controllers/projectController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,15 @@ export class ProjectController {
const templateRoot: string = path.join(this.context.extensionPath, "templates");
const projectFile: string = path.join(projectRoot, ".project");
try {
let jdkSpecificTemplateRoot: string = path.join(templateRoot, `Java${javaVersion}`);
if (!await fse.pathExists(jdkSpecificTemplateRoot)) {
// fall back to 8
jdkSpecificTemplateRoot = path.join(templateRoot, `Java8`);
}
await fse.ensureDir(projectRoot);

await Promise.all([
fse.copy(path.join(templateRoot, "App.java.sample"), path.join(projectRoot, "src", "app", "App.java")),
fse.copy(path.join(templateRoot, `Java${javaVersion}`), projectRoot),
fse.copy(jdkSpecificTemplateRoot, projectRoot),
fse.copy(path.join(templateRoot, ".project"), path.join(projectRoot, ".project")),
fse.ensureDir(path.join(projectRoot, "bin")),
]);
Expand Down
6 changes: 6 additions & 0 deletions templates/Java11/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the JDK 9/10 support

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JUST to keep 9/10 since there is no reason why we forbid the obsoleted the version strictly

<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-10"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
11 changes: 11 additions & 0 deletions templates/Java11/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=10
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=10
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=10