Skip to content

Cannot import class files from package in classpath #45

@erlendviggen

Description

@erlendviggen

I am writing a Java package that I would like to experiment with in IJava. I have compiled it and put it in a folder that we can call /path/to/package/ for the sake of the example. More specifically, if my Java package name is example.package.name, there are some class files in the folder /path/to/package/example/package/name/.

For jshell, it works well to make my package available through the classpath argument:

jshell --class-path "/path/to/jars/*:/path/to/package"

This way, I can import and use packages from the .jar files in in /path/to/jars/ and my own package in /path/to/package/.

I am trying to get the same classpath to work in IJava with the following environment argument in kernel.json:

"IJAVA_CLASSPATH": "/path/to/jars/*:/path/to/package"

While this successfully lets me import packages from the .jar files like jshell does, it does not let me import my own package. Instead, the statement import example.package.name.* results in an error

| import example.package.name.*;
package example.package.name does not exist

Could this be a bug or a missing feature in IJava?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcategory: kernelIssues related to things that need to be fixed inside the kernel.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions