Adding jars with "/cp Foobar.jar" does not seem to put the JAR on the classpath of the project-specific JShell. That needs to be supported.
FYI: On a Mac with OS X 10.11, NetBeans 8.2, this doesn't work as well.
It's simply not supported yet in the NetBeans JShell integration, I believe. Early days and it's amazing all the features that are there already, really cool integration and I'm going to be using this more and more, especially when the issues we've filed so far are fixed.
what should be the effect ? It *could* be possible to adjust CP of the jshell, but should not affect the project's settings.
the desired effect is as follow:
I want to use "/cp Foobar.jar" so that I can import those classes and use them like I would do with build-ins.
The classpath of the project need not to be modified.
At the moment I observe the following behavior: I can import classes from the projects Maven dependencies without error, but the moment I try to use them, I end up with a class not found exception.
Partial support provided in jet-main#36707b9bc76c; still need to implement pathname completion.
Integrated into 'main-silver', will be available in build *201611270001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Svata Dedic <email@example.com>
Log: #268424: initial /classpath support in JShell
Completion enhanced in jet-main#d965ddd6800a
Relative paths to project contents are also supported.
i tried this on a mac with 201611300001, but the JShell is barely usable when opened from a Maven project anymore:
| Unexpected exception reading start-up: java.lang.NullPointerException
| Welcome to the JShell NetBeans integration
| Type /help for help
 -> 1+1
| The remote Java Shell has terminated. Restart the Java Shell to continue
| Expression value is: null
| assigned to temporary variable $1 of type int
The download for the later builds (from 20161201 upwards) is broken, I tried http://bits.netbeans.org/dev/nightly/2016-12-01_00-01-33/ in 3 browsers, no download buttons.
Will the patch make it into http://deadlock.netbeans.org/job/prototypes-repl9/? I used that repo to get JShell into my stable build.
what JDK does the mvn project target ?
The prototype branch is more or less dead; if extremely needed, some changes can be backported, but javac binaries started to diverge between trunk and repl-prototype.
I'll focus on maven support next week (I was primarily working with J2SE projects).
I tried with JDK 1.8 and 1.7.
Prototype branch: I think you already do have enough work todo. Not extremely needed.
Thanks for working on this.
Please be aware that support for JDK 7 may be dropped (depends on time). The code in JShell, which is largely used in the "vm agent" uses heavily lambdas. I'm not sure if I am able to cut/replace all the dependencies in the new code drop so the classes are still usable on 1.7.
As JDK 1.7 is EOLed, it's not a superhigh priority, although there are lot of JEE deployments on that platform.
I don't need JDK 7, just tried both to give feedback.
I don't expect it to be supported.
Using the latest build from December I was able to create this http://info.michael-simons.eu/2016/12/19/using-jshell-in-netbeans/
Really useful, thanks!