Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is it possible to limit which java packages require no import statements? #156

Open
david-romano opened this issue Mar 1, 2024 · 2 comments

Comments

@david-romano
Copy link

Context: I'm using IJava to teach Java via Google Colab Jupyter notebooks, and I just realized that no import statements are necessary for, say, access to the contents of the java.io package. I'd like to mimic the environment students will encounter when they start using an IDE, where the default is often that only the contents of the java.lang package are available without import. Is this something I could easily mimic with IJava?

Thanks,
David Romano

@andrus
Copy link

andrus commented May 14, 2024

(Editing my earlier answer)

The source of default imports is this file: https://github.com/SpencerPark/IJava/blob/master/src/main/resources/ijava-jshell-init.jshell , which is loaded unconditionally on kernel startup. So the only way to get rid of it is to create a custom kernel build. Should probably make it conditional in JJava.

@andrus
Copy link

andrus commented Jul 6, 2024

We may actually be working on this as a part of another feature in JJava: dflib/jjava#28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants