apache / apache/netbeans

Add 'compact java file' to templates

Open
#8,744 7 comments 0 reactions 0 assignees View on GitHub
Java kind:feature
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Description

From Cay Horstmanns talk I got the idea to add a compact java template file,
so that in an onramp for students you can do

new file > compact-java-file.

This would then create a file along the line of

```java
void main(){
IO.print("Hello world");
}
```

Having such a file will allow you to run it from the current version (27) of NetBeans IDE and would
nicely line up with the onramping effort in Java and keep the big 🐍 away.

See [Cay Horstmanns talk at JavaOne 2205](https://www.youtube.com/watch?v=04wFgshWMdA)

### Use case/motivation

There are several effort to make the on-ramping of Java easier.
In the language itself, with compact java files, the new IO package, with short methods for printing etc.

Having this in the IDE as well would be a nice thing.

### Related issues

Compact files work well in Java 27, in particular for starting student projects.

### Are you willing to submit a pull request?

No

Contributor guide

Open the contributing guide

Research direction

Start at the NetBeans New File entry point and inspect existing Java template definitions to determine where a compact Java file belongs. Compare the generated file with the example in the issue and verify that it can run in NetBeans 27; done means the compact-java-file option creates the requested starter source.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.