EgorKulikov / idea-chelper

Automatically exported from code.google.com/p/idea-chelper
112 stars 59 forks source link

Failed to locate JWS and launch TopCoder Arena #73

Open m1kit opened 5 years ago

m1kit commented 5 years ago

I'm using IDEA comes with JetBrains Toolbox on mac, and I cannot launch TopCoder Arena. I think this is because bundled JDK doesn't come with javaws.

java.lang.RuntimeException: java.io.IOException: Cannot run program "/Users/*username*/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/183.4886.37/IntelliJ IDEA.app/Contents/jdk/Contents/Home/jre/bin/javaws": error=2, No such file or directory
    at net.egork.chelper.actions.TopCoderAction.actionPerformed(TopCoderAction.java:54)
    at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:258)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:275)
    at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:184)
    at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:148)
    at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:410)
    at java.awt.Component.processEvent(Component.java:6313)
    at java.awt.Container.processEvent(Container.java:2237)
    at java.awt.Component.dispatchEventImpl(Component.java:4903)
    at java.awt.Container.dispatchEventImpl(Container.java:2295)
    at java.awt.Component.dispatchEvent(Component.java:4725)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
    at java.awt.Container.dispatchEventImpl(Container.java:2281)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4725)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
    at java.awt.EventQueue.access$500(EventQueue.java:98)
    at java.awt.EventQueue$3.run(EventQueue.java:715)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
    at java.awt.EventQueue$4.run(EventQueue.java:737)
    at java.awt.EventQueue$4.run(EventQueue.java:735)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:719)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:664)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:363)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.io.IOException: Cannot run program "/Users/*username*/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/183.4886.37/IntelliJ IDEA.app/Contents/jdk/Contents/Home/jre/bin/javaws": error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at net.egork.chelper.actions.TopCoderAction.actionPerformed(TopCoderAction.java:52)
    ... 37 more
Caused by: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
    at java.lang.ProcessImpl.start(ProcessImpl.java:134)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
    ... 38 more
lazakrisz commented 5 years ago

I've had a very similar problem to yours. I wasn't able to launch the TopCoder Arena app from Intellij after clicking on the icon. However I noticed that my Mac had access to the javaws command. Type in terminal: javaws it should display the regular Java Web Start information (same as man javaws)

Now I typed: which javaws -- location of javaws /usr/bin/javaws -- terminal returned this. So I used cd /usr/bin/ When I was in this folder I open it in Finder using the: open . command and noticed that javaws is a shortcut for the actual Java Web Start so I highlighted javaws file and pressed CMD + i (or right click Get Info). It showed me that the actual location for the file is: (Marked as original in the Finder Get Info tab) /System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/javaws image And I navigated to that directory and finally javaws was located in that dir. I just CMD + C on it and then navigated to IntelliJ (under Applications directory) right click show package contents and then navigated to where the error message was pointing that the javaws file was missing. In my case it was: Cannot run program "/Applications/IntelliJ IDEA CE.app/Contents/jdk/Contents/Home/jre/bin/javaws": error=2, No such file or directory so I pasted the javaws file there into /Applications/IntelliJ IDEA CE.app/Contents/jdk/Contents/Home/jre/bin/javaws image And now: image Everything seems to be working just fine! Hope this helps. I believe that this is not really an issue with CHelper but IntelliJ or Java JDK / JRE since they dropped support for Java Web Start and it was replaced by something else. And I apologize for the ugly formatting as well. EDIT: I also realize that you had another Issue open regarding this problem, but thought this info might prove useful for some, since I've been trying to get this to work for some time, and often GitHub popped up in my google search results.