I just upgraded to the latest version of Java today (Java 8 Update 101)
Since then, every time I try to run any Java program, it crashes with the following error:
Error message

Here is the contents of the error:
Exception Name: JavaNativeException
Description: java.lang.NullPointerException
User Info: (null)
0 CoreFoundation 0x00007fffb962952b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fffcdd01cad objc_exception_throw + 48
2 CoreFoundation 0x00007fffb9629479 -[NSException raise] + 9
3 JavaNativeFoundation 0x000000010e7266d8 JNFCallObjectMethod + 230
4 liblwawt.dylib 0x00000001101fa09e -[AWTView attributedSubstringForProposedRange:actualRange:] + 78
5 AppKit 0x00007fffb7b70604 -[NSTextInputContext(NSInputContext_WithCompletion) attributedSubstringForProposedRange:completionHandler:] + 105
6 AppKit 0x00007fffb7b6c6ec __55-[NSTextInputContext handleTSMEvent:completionHandler:]_block_invoke.625 + 91
7 AppKit 0x00007fffb7b66e9a -[NSTextInputContext tryHandleTSMEvent_attributedSubstringForProposedRange_withContext:dispatchCondition:dispatchWork:continuation:] + 92
8 AppKit 0x00007fffb7b6c616 __55-[NSTextInputContext handleTSMEvent:completionHandler:]_block_invoke.620 + 450
9 AppKit 0x00007fffb73cd760 -[NSTextInputContext handleTSMEvent:completionHandler:] + 2549
10 AppKit 0x00007fffb73cccfd _NSTSMEventHandler + 319
11 HIToolbox 0x00007fffb8b190d5 _ZL23DispatchEventToHandlersP14EventTargetRecP14OpaqueEventRefP14HandlerCallRec + 1708
12 HIToolbox 0x00007fffb8b18346 _ZL30SendEventToEventTargetInternalP14OpaqueEventRefP20OpaqueEventTargetRefP14HandlerCallRec + 428
13 HIToolbox 0x00007fffb8b1818f SendEventToEventTargetWithOptions + 43
14 HIToolbox 0x00007fffb8b6ef86 SendTSMEvent_WithCompletionHandler + 408
15 HIToolbox 0x00007fffb8d22378 __SendTextInputEvent_WithCompletionHandler_block_invoke + 584
16 HIToolbox 0x00007fffb8d20689 SendTextInputEvent_WithCompletionHandler + 1154
17 HIToolbox 0x00007fffb8d91829 -[IMKInputSession _postEvent:completionHandler:] + 176
18 HIToolbox 0x00007fffb8da1485 -[IMKInputSession _copyUniCharsForRange:intoBuffer:ofLength:completionHandler:] + 530
19 HIToolbox 0x00007fffb8da1c0e -[IMKInputSession _coreAttributesFromRange:whichAttributes:completionHandler:] + 281
20 HIToolbox 0x00007fffb8da3bb0 -[IMKInputSession attributedSubstringFromRange:completionHandler:] + 186
21 HIToolbox 0x00007fffb8d943ab __61-[IMKInputSession imkxpc_attributedSubstringFromRange:reply:]_block_invoke + 530
22 CoreFoundation 0x00007fffb95bf3ac __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
23 CoreFoundation 0x00007fffb95a0424 __CFRunLoopDoBlocks + 356
24 CoreFoundation 0x00007fffb959ff66 __CFRunLoopRun + 1878
25 CoreFoundation 0x00007fffb959f5b4 CFRunLoopRunSpecific + 420
26 HIToolbox 0x00007fffb8b40f6c RunCurrentEventLoopInMode + 240
27 HIToolbox 0x00007fffb8b40da1 ReceiveNextEventCommon + 432
28 HIToolbox 0x00007fffb8b40bd6 _BlockUntilNextEventMatchingListInModeWithFilter + 71
29 AppKit 0x00007fffb72375f5 _DPSNextEvent + 1093
30 AppKit 0x00007fffb79478eb -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1637
31 libosxapp.dylib 0x00000001102974e3 -[NSApplicationAWT nextEventMatchingMask:untilDate:inMode:dequeue:] + 124
32 AppKit 0x00007fffb722bfbd -[NSApplication run] + 926
33 libosxapp.dylib 0x0000000110297346 +[NSApplicationAWT runAWTLoopWithApp:] + 156
34 liblwawt.dylib 0x00000001101ed17d -[AWTStarter starter:] + 873
35 Foundation 0x00007fffbafebf2a __NSThreadPerformPerform + 326
36 CoreFoundation 0x00007fffb95bf551 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
37 CoreFoundation 0x00007fffb95a06bd __CFRunLoopDoSources0 + 557
38 CoreFoundation 0x00007fffb959fbb6 __CFRunLoopRun + 934
39 CoreFoundation 0x00007fffb959f5b4 CFRunLoopRunSpecific + 420
40 java 0x000000010426e3b0 CreateExecutionEnvironment + 871
41 java 0x0000000104268b5c JLI_Launch + 1952
42 java 0x000000010426e70d main + 101
43 java 0x00000001042683b4 start + 52
I heard about other users having a similar problem, some recently and some of them in 2014, 2010, 2006, etc.
I tried uninstalling Java using cmd and also editing the environment variable, although I just copied and pasted what I found on the Internet and did not understand what I was doing:
attempt to remove / delete environmental rights

, , , , mac (, , , , )
, :
youtube.com/watch?v=JF_o8WNt3hs&feature=youtu.be
Java, netbeans, . , , , , , , .