0

I am trying to run Caver Analyst 2.0 on Mac OS Big Sur 11.4. I have followed all the suggestions at Cannot find java. Please use the --jdkhome switch and nothing seems to work.

When I try to run it, I get the error:

The operation couldn’t be completed. Unable to locate a Java Runtime that supports (null). Please visit http://www.java.com for information on installing Java.

Found jdkhome= Cannot find java. Please use the --jdkhome switch.

I manually specified the location of Java:

/Users/Downloads/caver_analyst2-2/bin/caver_analyst --jdkhome /Library/Java/JavaVirtualMachines/jdk-16.0.1.jdk/Contents/Home/bin/java

But get:

Cannot find java. Please use the --jdkhome switch.

I also tried modifying the .conf file adding the Java path:

jdkhome="/Library/Java/JavaVirtualMachines/jdk-16.0.1.jdk/Contents/Home/bin/java" 

But I get the same message.

Finally, I tried to specify a slightly different directory as suggested in the cited thread:

/Users/Downloads/caver_analyst2-2/bin/caver_analyst --jdkhome /Library/Java/JavaVirtualMachines/jdk-16.0.1.jdk/Contents/Home/

But I get:

Jun. 21, 2021 2:51:54 P.M. cz.caver.Main main
INFO: Using default userdir: /Users/Library/Application Support/caver_analyst/2.0b2
Jun. 21, 2021 2:51:54 P.M. org.netbeans.ProxyURLStreamHandlerFactory register
SEVERE: No way to find original stream handler for jar protocol
java.lang.reflect.InaccessibleObjectException: Unable to make field transient java.net.URLStreamHandler java.net.URL.handler accessible: module java.base does not "opens java.net" to unnamed module @40f9161a
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357)
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
    at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:177)
    at java.base/java.lang.reflect.Field.setAccessible(Field.java:171)
    at org.netbeans.ProxyURLStreamHandlerFactory.register(ProxyURLStreamHandlerFactory.java:82)
    at org.netbeans.JarClassLoader.<clinit>(JarClassLoader.java:129)
    at org.netbeans.MainImpl.execute(MainImpl.java:178)
    at org.netbeans.MainImpl.main(MainImpl.java:85)
    at org.netbeans.Main.main(Main.java:78)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    at cz.caver.Main.main(Main.java:124)

Exception in thread "main" java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    at cz.caver.Main.main(Main.java:124)
Caused by: java.lang.ExceptionInInitializerError
    at org.openide.util.lookup.implspi.ActiveQueue.queue(ActiveQueue.java:70)
    at org.openide.util.lookup.AbstractLookup.activeQueue(AbstractLookup.java:755)
    at org.openide.util.lookup.AbstractLookup.access$600(AbstractLookup.java:80)
    at org.openide.util.lookup.AbstractLookup$ReferenceToResult.<init>(AbstractLookup.java:1353)
    at org.openide.util.lookup.AbstractLookup$ReferenceToResult.<init>(AbstractLookup.java:1336)
    at org.openide.util.lookup.AbstractLookup.lookup(AbstractLookup.java:491)
    at org.openide.util.Lookup.lookupResult(Lookup.java:251)
    at org.openide.util.Lookup.lookupAll(Lookup.java:271)
    at org.netbeans.MainImpl$BootClassLoader.allCLIs(MainImpl.java:368)
    at org.netbeans.CLIHandler.initialize(CLIHandler.java:383)
    at org.netbeans.MainImpl.execute(MainImpl.java:193)
    at org.netbeans.MainImpl.main(MainImpl.java:85)
    at org.netbeans.Main.main(Main.java:78)
    ... 5 more
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.lang.ref.ReferenceQueue$Lock java.lang.ref.ReferenceQueue.lock accessible: module java.base does not "opens java.lang.ref" to unnamed module @40f9161a
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357)
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
    at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:177)
    at java.base/java.lang.reflect.Field.setAccessible(Field.java:171)
    at org.openide.util.lookup.implspi.ActiveQueue$Impl.<clinit>(ActiveQueue.java:83)
    ... 18 more

Any help is appreciated!

Update: When running the app with Java 1.8, as suggested by @skomisa:

/Users/Downloads/caver_analyst2-2/bin/caver_analyst --jdkhome "/Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk" 

The app does start, however, a couple of seconds later it is terminated and I get the following (very long) error:

INFO: Using default userdir: /Users/amir/Library/Application Support/caver_analyst/2.0b2
2021-06-22 13:14:03.888 java[1479:13651] Apple AWT Internal Exception: NSWindow drag regions should only be invalidated on the Main Thread!
2021-06-22 13:14:03.888 java[1479:13651] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff204c487b __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x00007fff201fcd92 objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff204ecf76 -[NSException raise] + 9
    3   AppKit                              0x00007fff22c74462 -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 321
    4   AppKit                              0x00007fff22c5f042 -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1296
    5   AppKit                              0x00007fff22c5eb2b -[NSWindow initWithContentRect:styleMask:backing:defer:] + 42
    6   libnativewindow_macosx.jnilib       0x000000019ee363fe Java_jogamp_nativewindow_macosx_OSXUtil_CreateNSWindow0 + 398
    7   ???                                 0x00000001158466c7 0x0 + 4655965895
)
libc++abi: terminating with uncaught exception of type NSException
/Users/amir/Downloads/caver_analyst2-2/bin/../platform/lib/nbexec: line 620:  1479 Abort trap: 6           "/Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home/bin/java" -Djdk.home="/Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home" -classpath "/Users/amir/Downloads/caver_analyst2-2/platform/lib/patches/boot-JarClassLoader.jar:/Users/amir/Downloads/caver_analyst2-2/platform/lib/patches/boot-ModuleManager.jar:/Users/amir/Downloads/caver_analyst2-2/platform/lib/patches/boot.jar:/Users/amir/Downloads/caver_analyst2-2/platform/lib/boot.jar:/Users/amir/Downloads/caver_analyst2-2/platform/lib/org-openide-modules.jar:/Users/amir/Downloads/caver_analyst2-2/platform/lib/org-openide-util-lookup.jar:/Users/amir/Downloads/caver_analyst2-2/platform/lib/org-openide-util.jar:/Users/amir/Downloads/caver_analyst2-2/platform/lib/locale/boot_ja.jar:/Users/amir/Downloads/caver_analyst2-2/platform/lib/locale/boot_pt_BR.jar:/Users/amir/Downloads/caver_analyst2-2/platform/lib/locale/boot_ru.jar:/Users/amir/Downloads/caver_analyst2-2/platform/lib/locale/boot_zh_CN.jar:/Users/amir/Downloads/caver_analyst2-2/platform/lib/locale/org-openide-modules_ja.jar:/Users/amir/Downloads/caver_analyst2-2/platform/lib/locale/org-openide-modules_pt_BR.jar:/Users/amir/Downloads/caver_analyst2-2/platform/lib/locale/org-openide-modules_ru.jar:/Users/amir/Downloads/caver_analyst2-2/platform/lib/locale/org-openide-modules_zh_CN.jar:/Users/amir/Downloads/caver_analyst2-2/platform/lib/locale/org-openide-util-lookup_ja.jar:/Users/amir/Downloads/caver_analyst2-2/platform/lib/locale/org-openide-util-lookup_pt_BR.jar:/Users/amir/Downloads/caver_analyst2-2/platform/lib/locale/org-openide-util-lookup_ru.jar:/Users/amir/Downloads/caver_analyst2-2/platform/lib/locale/org-openide-util-lookup_zh_CN.jar:/Users/amir/Downloads/caver_analyst2-2/platform/lib/locale/org-openide-util_ja.jar:/Users/amir/Downloads/caver_analyst2-2/platform/lib/locale/org-openide-util_pt_BR.jar:/Users/amir/Downloads/caver_analyst2-2/platform/lib/locale/org-openide-util_ru.jar:/Users/amir/Downloads/caver_analyst2-2/platform/lib/locale/org-openide-util_zh_CN.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home/lib/tools.jar" -Dnetbeans.system_http_proxy="DIRECT" -Dnetbeans.system_http_non_proxy_hosts="" -Dnetbeans.dirs="/Users/amir/Downloads/caver_analyst2-2/caver_analyst:/Users/amir/Downloads/caver_analyst2-2/harness:/Users/amir/Downloads/caver_analyst2-2/nb:/Users/amir/Downloads/caver_analyst2-2/Cavities:" -Dnetbeans.home="/Users/amir/Downloads/caver_analyst2-2/platform" '-Dcom.apple.mrj.application.apple.menu.about.name=caver_analyst' '-Xdock:name=caver_analyst' '-Xdock:icon=/Users/amir/Downloads/caver_analyst2-2/bin/../../caver_analyst.icns' '-Dplugin.manager.check.interval=EVERY_DAY' '-Dapp.version=2.0b2' '-Xms256m' '-Xmx1000m' -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="/Users/amir/Library/Application Support/caver_analyst/2.0b2/var/log/heapdump.hprof" -Dnetbeans.user="/Users/amir/Library/Application Support/caver_analyst/2.0b2" cz/caver/Main --userdir "/Users/amir/Library/Application Support/caver_analyst/2.0b2" "--branding" "caver_analyst" 0<&0
amir@Amirs-MacBook-Pro ~ % sudo /Users/amir/Downloads/caver_analyst2-2/bin/caver_analyst --jdkhome "/Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk"
skomisa
  • 16,436
  • 7
  • 61
  • 102
amiro
  • 1
  • 2
  • Update your question to state your exact version of NetBeans. – skomisa Jun 21 '21 at 22:42
  • You are specifying a value for **jdkhome** in the conf file (_netBeans.conf_), but you should be specifying a value for **netbeans_jdkhome** instead. – skomisa Jun 21 '21 at 22:49
  • Hey @skomisa, I am not changing any netbeans .conf file, only the Caver Analyst (the program I am trying to run) one. – amiro Jun 21 '21 at 23:20
  • [1] OK, but NetBeans also has a **.conf** file that allows you to specify the path to your JDK, as described in the accepted answer for the question you linked to. And you are using NetBeans to run the Caver Analyst application, right? If so, which version of NetBeans are you using, and what version of Java? [2] It looks like someone else also has had a problem with `ProxyURLStreamHandlerFactory` when running the application on macOS Sierra, as shown in [Caver Analyst bug report #256](https://www.caver.cz/index.php?sid=145&issueid=256), although it does not seem to have been resolved. – skomisa Jun 22 '21 at 07:02
  • [3] It looks like [CAVER Analyst 2.0 requires the use of Java 1.8](https://www.caver.cz/index.php?sid=199). What is NetBeans is using? (**Help > About** will tell you.) – skomisa Jun 22 '21 at 07:06
  • [1]I am not using NetBeans to run Caver; I only go to Terminal and try to open it from there as described in the question. [2] When I run `java -version`, I get: `java version "16.0.1" 2021-04-20 Java(TM) SE Runtime Environment (build 16.0.1+9-24) Java HotSpot(TM) 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)`. So my version of java should not be the problem, right? – amiro Jun 22 '21 at 14:28
  • I think the opposite is true; your version of Java probably is the problem. The link in my previous comment to requirements for CAVER Analyst 2.0 gave **Java 1.8** (n.b. not _"Java 1.8 or later"_) as a software requirement. Try running with Java 1.8 instead of Java 16, and if you still have problems update your question accordingly. – skomisa Jun 22 '21 at 16:27
  • Your suggestion did start up the app (running on Java 1.8 now), unfortunately, it crashes immediately after and produces a termination error- see the updated question. Thanks for your help, btw! – amiro Jun 22 '21 at 17:22
  • [1] Your updated stack trace suggests that you are still somehow picking up a Java runtime > 1.8. [This SO question with a somewhat similar problem on macOS](https://stackoverflow.com/a/46556172/2985643) is showing similar diagnostics to yours. [2] If (and only if) it doesn't cause you any problems, could you uninstall all Java versions > 1.8, and try again? [3] I know nothing about macOS. Perhaps create a bug report on [Caver's web site](https://www.caver.cz/index.php?sid=243) via **Support > Report Issue**? You will need an account to do that. – skomisa Jun 22 '21 at 18:27
  • One final question: you did update Caver's **.conf** file to replace the JDK 16 path with the JDK 1.8 path, right? I can imagine that starting Caver Analyst using JDK 1.8 while its **.conf** file is pointing to JDK 16 might cause problems. – skomisa Jun 22 '21 at 18:41
  • Hey @skomisa, I removed all my other JDK versions and it still produces the same error. I checked I only had one working version with `/usr/libexec/java_home -V` and got `1.8.291.10 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home 1.8.0_291 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home` I did update the .conf file, but did not work. I have the feeling we're very close to solving this, hopefully. – amiro Jun 23 '21 at 15:29
  • [1] OK, that is progress, and I can't see that you are doing anything incorrectly now. [2] However, I have no ideas about that macOS error _"NSWindow drag regions should only be invalidated on the Main Thread!"_. One possibility is that it may be related to running Caver Analyst 2.0 on Big Sur, and that combination has never been tested by Caver. Perhaps verify that your video driver is current? [3] At this point I can only offer two (rather weak) suggestions: raise a bug report with Caver, and/or attempt to install and run Caver Analyst 2.0 on Windows instead (if that is possible). – skomisa Jun 23 '21 at 18:43
  • Thanks, @skomisa. I have tried running on Catalina and gave me the same output. I will try running on Windows. I do want to run Caver on this mac though, so I will be raising a bug report and maybe another stack user has experience with the NSWindow error. – amiro Jun 23 '21 at 21:39
  • OK. Please be sure to answer your own question here if you get a resolution, since that would be helpful for the SO community. – skomisa Jun 24 '21 at 02:21

0 Answers0