Git Product home page Git Product logo

ijava's People

Contributors

claudiodavi avatar frankfliu avatar mapio avatar spencerpark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ijava's Issues

Can't use wildcards in IJAVA_CLASSPATH option

I'm using IJava to explore some Java libraries that I want to familiarise myself with, and it's working out really well for me so far. However, I came upon a minor issue when pointing the IJava classpath to multiple libraries in multiple .jar files stored in the same directory.

Explicitly pointing to the individual .jar files in kernel.json works perfectly:

"IJAVA_CLASSPATH" : "/path/to/lib/Lib1.jar:/path/to/lib/Lib2.jar:/path/to/lib/Lib3.jar"

However, it is possible to use wildcards in Java classpaths to point to multiple .jar files in one directory. For example, this works for me when launching jshell:

jshell --class-path "/path/to/lib/*"

However, if I try to similarly use a wildcard in kernel.json,

"IJAVA_CLASSPATH" : "/path/to/lib/*"

then IJava reports that it does not work:

|   import path.to.class.ClassName;
package path.to.class does not exist

It's a small issue with an easy workaround (explicitly pointing to all the libraries), but I thought I'd report it regardless.

Keyboard input issue with iJava in MacOS 10.13.6

I have written the following java program:

ArrayList <String> sArr = new ArrayList<>();
Scanner keybd = new Scanner(System.in);
for (int i = 0; ; i++)
{
    System.out.println("Type a number. Terminate by giving -99");
    String input = keybd.nextLine();
    if (input.contains("-99"))
        break;
    sArr.add(input);
}

for (String s1 : sArr)
    System.out.println(s1);

The first for loop should exit on receiving -99 from keyboard and the second for loop should print the numbers read. But, the first for loop continues to get standard input ad infinitum even after -99 is entered. A similar issue #14 is reported to be closed, but the bug seems to be rearing its ugly head still.

Build fails due to plugin com.github.hierynomus.license not found

The error is
FAILURE: Build failed with an exception.

  • Where:
    Build file '/IJava/build.gradle' line: 4

  • What went wrong:
    Plugin [id: 'com.github.hierynomus.license', version: '0.14.0'] was not found in any of the following sources:

  • Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
  • Plugin Repositories (could not resolve plugin artifact 'com.github.hierynomus.license:com.github.hierynomus.license.gradle.plugin:0.14.0')
    Searched in the following repositories:
    Gradle Central Plugin Repository
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2s

Internal exception when executing '}'

When executing a cell with just } there is an error during source highlighting that causes an internal out of bounds exception. The diagnostic getEndPosition can return -1 for diagnostics that don't have an associated position.

Compilation fails due to later versions of jdk 9 removing tools.js

Running on ubuntu 16.04 in a virtual machine, and openjdk-9-jdk version 9~b114-0ubuntu1
I get the following output:

`./gradlew installKernel --stacktrace

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileJava'.

java.lang.reflect.UndeclaredThrowableException

  • Try:
    Run with --info or --debug option to get more log output.

  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':compileJava'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
    at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
    at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
    at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:59)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:128)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
    at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:46)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
    at org.gradle.initialization.DefaultGradleLauncher$ExecuteTasks.run(DefaultGradleLauncher.java:314)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.initialization.DefaultGradleLauncher.runTasks(DefaultGradleLauncher.java:204)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:134)
    at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:109)
    at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:78)
    at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:75)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
    at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100)
    at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:75)
    at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.java:43)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:57)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:64)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:29)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:45)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    Caused by: java.lang.RuntimeException: java.lang.reflect.UndeclaredThrowableException
    at com.sun.tools.javac.api.JavacTool.getTask(jdk.compiler@9-internal/JavacTool.java:180)
    at com.sun.tools.javac.api.JavacTool.getTask(jdk.compiler@9-internal/JavacTool.java:109)
    at com.sun.tools.javac.api.JavacTool.getTask(jdk.compiler@9-internal/JavacTool.java:65)
    at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.createCompileTask(JdkJavaCompiler.java:67)
    at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:48)
    at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:36)
    at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:99)
    at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:52)
    at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:37)
    at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:35)
    at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:25)
    at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:204)
    at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:189)
    at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:121)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
    at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:179)
    at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:135)
    at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:122)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
    ... 102 more
    Caused by: java.lang.reflect.UndeclaredThrowableException
    at com.sun.proxy.$Proxy73.handleOption(Unknown Source)
    at com.sun.tools.javac.api.ClientCodeWrapper$WrappedJavaFileManager.handleOption(jdk.compiler@9-internal/ClientCodeWrapper.java:265)
    at com.sun.tools.javac.main.Arguments.doProcessArgs(jdk.compiler@9-internal/Arguments.java:375)
    at com.sun.tools.javac.main.Arguments.processArgs(jdk.compiler@9-internal/Arguments.java:294)
    at com.sun.tools.javac.main.Arguments.init(jdk.compiler@9-internal/Arguments.java:250)
    at com.sun.tools.javac.api.JavacTool.getTask(jdk.compiler@9-internal/JavacTool.java:175)
    ... 126 more
    Caused by: java.lang.IllegalAccessException: class org.gradle.api.internal.tasks.compile.reflect.SourcepathIgnoringInvocationHandler cannot access class com.sun.tools.javac.file.BaseFileManager (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.file to unnamed module @2154f367
    at org.gradle.api.internal.tasks.compile.reflect.SourcepathIgnoringInvocationHandler.invoke(SourcepathIgnoringInvocationHandler.java:65)
    ... 132 more`

Cannot import class files from package in classpath

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?

Kernel Interrupts Fail (can't stop long running commands)

I have a simple cell with

for (int i = 0; i < 20; i++) { System.out.println(i); Thread.sleep(1000); }

I hit the interrupt button in Jupyter expecting it will interrupt the command.
However the cell runs to completion and prints this in the console output:

[I 13:47:24.582 NotebookApp] Kernel interrupted: bcb8133c-58d3-4727-911c-2fca4dc40d5b
Sep 20, 2018 1:47:24 PM io.github.spencerpark.jupyter.channels.ShellChannel lambda$bind$16
SEVERE: Unhandled message: none

IJava issue with format strings in System.out.printf()

Hello,

I've been looking for a Java kernel for Jupyter Notebook, and I'm really glad to have finally found your excellent IJava kernel. I've been testing it for a while now and all seems to be working great, except for one thing. I found a problem when using IJava kernel with the following example code using System.out.printf().

public class Employee {
    private String name;
    private double salary;
    
    public Employee(String name, double salary) {
        this.name = name;
        this.salary = salary;
    }

    public void showProfile() {
        System.out.printf("Name: %s%n", name);
        System.out.printf("Salary: %.2f%n", salary);
    }
}

This is the output when trying to execute the code:

|           System.out.printf("Name: __MAGICS.applyLineMagic(new String(Base64.getDecoder().decode("cyVuLCBuYW1lKTs=")),List.of());
')' expected

|           System.out.printf("Name: __MAGICS.applyLineMagic(new String(Base64.getDecoder().decode("cyVuLCBuYW1lKTs=")),List.of());
unclosed string literal

|           System.out.printf("Salary: %.2f__MAGICS.applyLineMagic(new String(Base64.getDecoder().decode("biwgc2FsYXJ5KTs=")),List.of());
')' expected

|           System.out.printf("Salary: %.2f__MAGICS.applyLineMagic(new String(Base64.getDecoder().decode("biwgc2FsYXJ5KTs=")),List.of());
unclosed string literal

From further inspection, I think it probably has something to do with parsing those "%s" and "%f" in the strings. It doesn't have to be with System.out.printf(). It actually happens anywhere where a string contains those format specifiers. A percent mark ("%") alone, though, will not produce the errors. It has to be a format specifier.

Please let me know if I could be of any further assistance.

Thanks,
Poonna

Automatically adding imports

HI, thanks for creating this, it seems to work well.

One question, jshell supports <Shift+Tab i> to import currently unimported classes. I have not been able to get this to work in IJava. Is there a way to get this to work, or any equivalent functionality?

first kernel instruction gives illegal character in notebook

Hello,

I'm trying to setup a java101 class using your kernel. It seems to kinda work, except that I have the following issue:

Upon restarting the kernel, the execution of the first instruction always return an illegal character error with some binary garbage. The second execution, however works as expected, see the attached screenshot
image

I can't reproduce the issue with a "jupyterlab console" or with a "terminal jupyter console", just with notebooks.

Installation info:

cbc186831b36ed557e7bc48b1cfcdc1e ijava-1.1.1.jar
4.4.0 jupyter --version
0.9.2 jupyterhub --version
10.0.2 javac -version
10.0.2 java -version
16.04 Ubuntu

System is installed with the following ansible playbook: https://github.com/nherbaut/jupyterhub-deploy-teaching

Thanks!

IJava will not run any Java code.

This error is occurring locally on machines which we installed IJava on and on a fresh binder installation created directly from the SpencerPark/ijava-binder base.

History:

  1. We have installed IJava on a number of linux Mint machines through apt-get and it was running fine last week. We have not consciously made an update to the machines in the intervening week, but currently suspect the error is due to an automated minor-point upgrade of Java.
  2. Because I thought the problem was with our configuration, I decided to use Binder and am getting exactly the same error in Binder.

Steps to reproduce.

  1. Create a new github repository. (Mine is at https://github.com/johncbowers/CS149_F18 if you just want to use mine.)
  2. Clone the https://github.com/SpencerPark/ijava-binder repository and copy all files to the new repository.
  3. Push changes.
  4. Open mybinder.org in a browser and enter your new github repo in the url field (again, you can use mine above).
  5. Create a new Java notebook.
  6. Enter
int x = 5;
System.out.println(x);

in the input field and hit SHIFT+ENTER.

In Binder, I have had two results from these actions. The first time, I got the following stack trace:


java.lang.IllegalStateException: No result with key: 0
at io.github.spencerpark.ijava.execution.IJavaExecutionControl.takeResult(IJavaExecutionControl.java:80)
at io.github.spencerpark.ijava.execution.CodeEvaluator.evalSingle(CodeEvaluator.java:78)
at io.github.spencerpark.ijava.execution.CodeEvaluator.eval(CodeEvaluator.java:122)
at io.github.spencerpark.ijava.JavaKernel.evalRaw(JavaKernel.java:251)
at io.github.spencerpark.ijava.JavaKernel.eval(JavaKernel.java:256)
at io.github.spencerpark.jupyter.kernel.BaseKernel.handleExecuteRequest(BaseKernel.java:307)
at io.github.spencerpark.jupyter.channels.ShellChannel.lambda$bind$16(ShellChannel.java:54)
at java.base/java.lang.Thread.run(Thread.java:844)
at io.github.spencerpark.jupyter.channels.Loop.run(Loop.java:44)

The second time, binder hanged and eventually turned into a completely white webpage (some black text temporarily flashed on the screen that appeared to be an error, but its gone). Actually now I can't hit it at all.

On our Mint machines, we are simply launching jupyter notebook, entering the same Java code as above, and receiving the same stack trace.

Strange behavior with undefined forward references

Executing a cell containing

List<String> test() { return new LinkedList<>(); }
test();

will not raise an error but will also not return an empty list. It silently fails.

Once the import is added the execution is fine and

import java.util.*;
List<String> test() { return new LinkedList<>(); }
test();

returns [].

This is likely due to List not yet being resolved and therefore the dependent snippet test() cannot execute but still compiles. Some further checks should be taken to better handle these types of snippet states, particularly RECOVERABLE_DEFINED case for the method where the call is a dependent or potentially also marked as RD?

Display additional media types

See the related issue SpencerPark/jupyter-jvm-basekernel#2 for richer rendering.

The trouble with the java kernel is that the evaluation always returns a string and so unfortunately we will need to double serialize the rendered data and somehow notify the kernel that the string it is receiving is in fact rich data.

This means that the serialization must happen within the shell (not the kernel) and will need some transformation like those done to support magics.

Defining enums

Is there any way to define enums?
Trying:

enum SpeedUnit {
    MS,
    KMH
}

gives

enum types must not be local
 enum SpeedUnit {
 ^     

gradlew fails to download gradle due to an SSLException on jdk-11 on ubuntu 18.04

`./gradlew installKernel
Downloading https://services.gradle.org/distributions/gradle-4.2.1-bin.zip

Exception in thread "main" javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at java.base/sun.security.ssl.Alerts.getSSLException(Alerts.java:214)
at java.base/sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1974)
at java.base/sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1926)
at java.base/sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1909)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1436)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
at java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:567)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1581)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1509)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:245)
at org.gradle.wrapper.Download.downloadInternal(Download.java:66)
at org.gradle.wrapper.Download.download(Download.java:51)
at org.gradle.wrapper.Install$1.call(Install.java:62)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at java.base/sun.security.validator.PKIXValidator.(PKIXValidator.java:89)
at java.base/sun.security.validator.Validator.getInstance(Validator.java:181)
at java.base/sun.security.ssl.X509TrustManagerImpl.getValidator(X509TrustManagerImpl.java:330)
at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrustedInit(X509TrustManagerImpl.java:180)
at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:192)
at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:133)
at java.base/sun.security.ssl.ClientHandshaker.checkServerCerts(ClientHandshaker.java:1947)
at java.base/sun.security.ssl.ClientHandshaker.certificateStatus(ClientHandshaker.java:1798)
at java.base/sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:276)
at java.base/sun.security.ssl.Handshaker.processLoop(Handshaker.java:1098)
at java.base/sun.security.ssl.Handshaker.processRecord(Handshaker.java:1026)
at java.base/sun.security.ssl.SSLSocketImpl.processInputRecord(SSLSocketImpl.java:1137)
at java.base/sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1074)
at java.base/sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
at java.base/sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1402)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1429)
... 14 more
Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at java.base/java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:200)
at java.base/java.security.cert.PKIXParameters.(PKIXParameters.java:120)
at java.base/java.security.cert.PKIXBuilderParameters.(PKIXBuilderParameters.java:104)
at java.base/sun.security.validator.PKIXValidator.(PKIXValidator.java:86)
... 29 more
`

Unable to create object named 'io' of type Integer

I have been trying to create an object of type Integer

Integer io = new Integer(10);
System.out.println(io)

but seem to be running into issues

|   Integer io = new Integer(10);
cannot find symbol
  symbol:   class 

|   Integer io = new Integer(10);
static import only from classes and interfaces

I can do it for the Long wrapper fine
Long lo = new Long(10);

I have tried this in a jshell and that works. I have verified that the jshell is using the jdk
java --list-modules | grep "jdk.jshell" [email protected]

Issue with reading user input

Hi again,

I've been trying to get user input on Jupyter Notebook without success. I'm not sure what the problem is, but the code here:

import java.util.Scanner;

Scanner input = new Scanner(System.in);
String s = input.next();
System.out.println(s);

produced this error:

---------------------------------------------------------------------------
java.util.NoSuchElementException: 
	at java.base/java.util.Scanner.throwFor(Scanner.java:858)
	at java.base/java.util.Scanner.next(Scanner.java:1381)
	at .(#19:1)

If I used input.nextLine() instead, I got a No line found error:

---------------------------------------------------------------------------
java.util.NoSuchElementException: No line found
	at java.base/java.util.Scanner.nextLine(Scanner.java:1554)
	at .(#19:1)

I tried switching to BufferedReader:

import java.io.BufferedReader;
import java.io.InputStreamReader;

BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s = reader.readLine();
System.out.println(s);

which resulted in:

null

I wonder if there's a way to get this to work. Please let me know if I could be of any help.

Thanks,
Poonna

API for programmatically embedding Tablesaw `Plot` graphs?

I want to embed custom graphs, and I'm not sure where to start. I'm a Java expert, but I'm new to Jupyter Notebook and IJava, so maybe you can point me to some documentation.

First of all I installed Anaconda and then installed the IJava kernel in Jupyter Notebook with no problem. So far it's working without a hitch using OpenJDK 11 on Windows 10!

Next I tried to use a Java-based dataframe package Tablesaw. I was able to add its Maven dependencies, load a CSV file, and create a plot. Very nice!

However to produce a graph Tablesaw generates a temporary HTML file using Plotly, and invokes the browser to show the interactive plot. In other words, the graph does not appear inside Jupyter Notebook.

Tablesaw has an example at https://nbviewer.jupyter.org/github/benmccann/nbviewer-test/blob/master/Tablesaw.ipynb using the BeakerX kernel (not IJava), and as you can see (scroll down to "Play (Money)ball with Linear Regression"), they are embedding a Tablesaw Plot directly within Jupyter Notebook.

I just assumed that IJava was better and more up-to-date with the latest Java versions (because it's built directly on JShell), so before I switch to BeakerX I wanted to find out if I could do the same thing in IJava. Where do I start to figure out how to embed a Tablesaw Plot object as an interactive graph, the way they are doing that in BeakerX?

Kernel logo artwork

Thanks so much for creating this kernel, it already has been invaluable for use in introductory Java classes.

I'd like to contribute some logo artwork which will show up as a kernel icon when used in notebook mode. This works quite simple, if the kernel installation directory contains logo-32x32.png and logo-64x64.png then it will be used in the notebook interface. I'm not seeing any install related code in this repository (e.g. install.py) to which I could contribute so am for now including the icons in this issue?
logo-64x64
logo-32x32

Adding a screenshot to show how this addition could make it look more polished:
kernel_logo

How to import jar package?

Hi, thanks for create the IJava, it is well to work.
My question is how to import a jar package,
such as i would like to import jxl.jar package.
I tried to add the jar file path to json file, But if i modify the Json file, then the IJava can not working.
So how to import jar package?
In Eclipse, i just need to put the file to the lib path, so what should i do for solve this issue in IJava?
Best regards,
Fred

Allow installing in any directory

Currently one must run python3 install.py --sys-prefix in the directory containing install.py to install the package. It makes things a little bit easier if we can installing the package by specifying the absolute path of install.py.

SPIResolutionException leaks to the user

Running a cell with an undefined (potentially forward) reference inside a method raised an SPIResolutionException.

void test(Object o) {
    System.out.println(obj); // a typo, meant 'o'
}
test("IJava");

results in

jdk.jshell.spi.SPIResolutionException: resolution exception
	at .test(#44:1)
	at .(#45:1)

Unfortunately this exception is not very informative, nor does it contain much information as presented by JShell.

Maybe incompatible with zh_cn locale

My test enviroment :

  • IJava 1.1.2
  • jupyter 4.4.0
  • Windows 10 x64
  • windows language is CHS

There are right error hint in Chinese in jshell.
exception2

but it throw exception in jupyter
exception1

Simple variable declaration raises java.lang.IllegalStateException

When I declare a variable like:

int number;

The following exceptionsexception is thrown:

java.lang.IllegalStateException: No result with key: 0
at io.github.spencerpark.ijava.execution.IJavaExecutionControl.takeResult(IJavaExecutionControl.java:80)
at io.github.spencerpark.ijava.execution.CodeEvaluator.evalSingle(CodeEvaluator.java:78)
at io.github.spencerpark.ijava.execution.CodeEvaluator.eval(CodeEvaluator.java:122)
at io.github.spencerpark.ijava.JavaKernel.evalRaw(JavaKernel.java:251)
at io.github.spencerpark.ijava.JavaKernel.eval(JavaKernel.java:256)
at io.github.spencerpark.jupyter.kernel.BaseKernel.handleExecuteRequest(BaseKernel.java:307)
at io.github.spencerpark.jupyter.channels.ShellChannel.lambda$bind$16(ShellChannel.java:54)
at java.base/java.lang.Thread.run(Thread.java:844)
at io.github.spencerpark.jupyter.channels.Loop.run(Loop.java:44)

Why?

Loading jsh files

Hello,

I would like to know the current policy for loading jsh files when running Jupyter Notebook cells with IJava.

In jshell we can do:

$ jshell 
|  Welcome to JShell -- Version 11.0.2
|  For an introduction type: /help intro

jshell> /open test.jsh

jshell> test();
hello

In IPython loading Python scripts is quite straightforward, all we need to do is to use the magic %load <python.py>, but I couldn't find any way to do the same within IJava environment.

I think that it is generally a good idea to be able to hide boilerplate code within a Jupyter Notebook and I think that this is an important feature to add (if it is not yet available).

If no workaround is available, I'm willing to contribute.

Thank you,

Support maven dependency references at runtime

Notebooks should be able to bring in maven dependencies at runtime since we are able to change the classpath (this may wipe the state but there is no harm if they run at the start).

The interface for this can be through the magics.

Installation problem

I'm trying to install IJava from source as described in the README however I'm getting the following error:

$ ./gradlew installKernel
Failed to execute: python3 -m jupyter --data-dir.
Stdout:
        
Stderr:
        /usr/local/opt/python/bin/python3.7: No module named jupyter
Failed to execute: python3 -m jupyter --data-dir.
Stdout:
        
Stderr:
        /usr/local/opt/python/bin/python3.7: No module named jupyter

I guess the reason is that I've installed jupyter using conda and the installer can't find it.

$ jupyter kernelspec list
Available kernels:
  python2    /Users/pditommaso/miniconda2/share/jupyter/kernels/python2

Can't get SLF4J logging to work

I am trying to get slf4j to work within the notebooks because some 3rd party libs that I use need it. When I try to set jshell classpath directly through --class-path it works. If I set IJAVA_CLASSPATH in kernel.json to point to the logging jars or when I import them in the notebook, it does not work, it says SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

%maven org.slf4j:slf4j-api:1.7.16
%maven ch.qos.logback:logback-classic:1.0.13    
 
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.impl.StaticLoggerBinder;

Logger slf4jLogger = LoggerFactory.getLogger("T");
slf4jLogger.warn("Hi, {}", "Test");

How to give JDK path to IJava kernel ?

Hello,

I'm trying to run IJava kernel on Win7 without admin privilege. There is already a default JDK 8 installed in the system. I've copied JDK 9 folder in my home folder, checking JShell application is present. But when I launch Jupyter notebook and try to start Java kernel, I get this Exception :

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: io/github/spencerpark/ijava/IJava hasbeen compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Meaning that IJava is trying to use system JDK 8.
Unfortunatlely, I don't know how to tell IJava kernel where to get proper JDK.

Is there a way to give JDK path to IJava Kernel configuration ?

Thanks,
Frank

Cannot import JUnit

when I try to import JUnit
import static org.junit.Assert.assertEquals;
The notebook reports package org.junit does not exist.

I think this might have something to do with the dependencies in the pom.xml?

Unable to install jupyter-jvm-basekernel

Hello, I am learning Java recently and decide to use familiar Jupyter Notebook. I followed the README file to install "jupyter-jvm-basekernel". However, when I downloaded the whole project and tried to build it, my terminal sent this:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '9.0.4'.

My environment is Win10 with Java JDK 9.0.4

> java -version
java version "9.0.4"
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)

How can I fix it?

Maven resolution fails behind proxy

The %maven line magic code throws an error. I guess it is due to my proxy settings. It seems as if the resolver does not take into account the proxy settings? Is there a way to give the resolver a proxy configuration?

Command:
%maven org.knowm.xchart:xchart:3.5.2
or
%maven org.apache.commons:commons-math3:3.6.1

Result:

java.lang.RuntimeException: Exception occurred while running line magic 'maven': Unable to collect/resolve dependency tree for a resolution due to: Failed to collect dependencies at org.knowm.xchart:xchart:jar:3.5.2, caused by: Connection refused: connect
at .lineMagic(#9:10)
at .(#76:1)

I tried:
System.setProperty("http.proxyHost", proxyHost);
System.setProperty("https.proxyHost", proxyHost);
System.setProperty("http.proxyPort", proxyPort);
System.setProperty("https.proxyPort", proxyPort);

With this I can successfully make network communications, i.e. the proxy configuration works. E.g.:
URL url = new URL("http://www.example.org/");
InputStream in = url.openStream();
The above code works. However the maven resolution still fails.

Issue with open scanner field

When executing this code, then not entering anything in the input field and re-executing the code stops the entire project from working. Restarting the kernel fixes the issue.

System.out.println("Enter a string: ");
Scanner scan = new Scanner(System.in);
String s1 = scan.nextLine();

Switch to ivy for dependency management

After investigations in #32, maven doesn't appear to be the appropriate tool for the job. It simply does too much.

Looking into groovy's grape system (with a default resolution engine backed by ivy), ivy is much more suited for the job. First and foremost, it is a dependency management tool. This means we are getting a much smaller dependency as a lot of the unneeded extras provided by maven are not included. Secondly we still get all of the dependency management that we want out of shrinkwrap but with a more extensible API.

I believe that this switch could actually be a backwards compatible change thanks to IvyConvertPom. Since this might take some time it won't make it into the 1.2.0 release.

Why can't find the class? "kernel = new JavaKernel();"

Exception in thread "main" java.lang.NoClassDefFoundError: jdk/jshell/EvalException
at io.github.spencerpark.ijava.IJava.main(IJava.java:104)
Caused by: java.lang.ClassNotFoundException: jdk.jshell.EvalException
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more

Codemirror mimetype vs IJava mimetype

Thank you for building this kernel, it's super useful! I was just wondering why IJava sets mimetype as text/x-java-source - I was expecting it to be text/x-java as defined in CodeMirror. Code highlighting in Jupyter notebooks works most of the time, but sometimes code mirror mode changes to text from java and I feel like there might be a bug around that.

IJava setup:
https://github.com/SpencerPark/IJava/blob/master/src/main/java/io/github/spencerpark/ijava/JavaKernel.java#L117

Codemirror Java modeInfo:
https://github.com/codemirror/CodeMirror/blob/606498c6ff088e90b22fed5afbde28d94094979b/mode/meta.js#L71

Execution timeout option

Since the current interruption interface is not supported by the kernel (see #2) a beneficial feature is an optional cell timeout. The timeout can be configured via an environment variable and specified in the kernel.json like the VM/compiler options. If no timeout is specified then no timeout will occur.

Another beneficial place for this is in the server context of jupyter hub where kernels running infinite loops that are not killed don't run forever in the background if a user leaves the server.

not worked with jupyter notebook

'jupyter console --kernel=java' works fine with me. installed with newest version(from git)
when I choose the java kernel,the notebook shows kernel error,the error log is here:

Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tornado/web.py", line 1592, in _execute
result = yield result
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/usr/local/lib/python3.6/dist-packages/notebook/services/sessions/handlers.py", line 73, in post
type=mtype))
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/usr/local/lib/python3.6/dist-packages/notebook/services/sessions/sessionmanager.py", line 79, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/usr/local/lib/python3.6/dist-packages/notebook/services/sessions/sessionmanager.py", line 92, in start_kernel_for_session
self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 326, in wrapper
yielded = next(result)
File "/usr/local/lib/python3.6/dist-packages/notebook/services/kernels/kernelmanager.py", line 160, in start_kernel
super(MappingKernelManager, self).start_kernel(**kwargs)
File "/usr/local/lib/python3.6/dist-packages/jupyter_client/multikernelmanager.py", line 110, in start_kernel
km.start_kernel(**kwargs)
File "/usr/local/lib/python3.6/dist-packages/jupyter_client/manager.py", line 259, in start_kernel
**kw)
File "/usr/local/lib/python3.6/dist-packages/jupyter_client/manager.py", line 204, in _launch_kernel
return launch_kernel(kernel_cmd, **kw)
File "/usr/local/lib/python3.6/dist-packages/jupyter_client/launcher.py", line 128, in launch_kernel
proc = Popen(cmd, **kwargs)
File "/usr/lib/python3.6/subprocess.py", line 709, in init
restore_signals, start_new_session)
File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'java': 'java'

and my env is here:
system: Ubuntu 18.04.1 LTS
java :java version "10.0.2" 2018-07-17

kernel does not recognizes versions of Runtime up to 52.0

Hi,

I got to install the kernel ok, but when I open jupyter-notebook and I choose the java kernel, it appears this error on terminal:

Error description:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: io/github/spencerpark/ijava/IJava has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0

I'm using Linux Fedora 28 KDE

and I've instaled the kernel using skd-9.0.4

My system out to java -version is:

java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

Assertions

Is there a way to use Java assertions?

Using a Python3 kernel and the line:

assert(1==2)

an AssertionError is returned:

AssertionErrorTraceback (most recent call last)
<ipython-input-2-000000000000> in <module>()
----> 1 assert(1==2);

AssertionError:

Using the IJava kernel and the same line, there is no return value or exception displayed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.