Hot questions for Using Applets in macos

Question:

After I update my mac to macOs Sierra, i have problems with java applets in Safari. They didn't start, or start and crash.

Process:               java [2271]
Path:                  /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
Identifier:            net.java.openjdk.cmd
Version:               1.0 (1.0)
Code Type:             X86-64 (Native)
Parent Process:        plugin-container [2270]
Responsible:           java [2271]
User ID:               501

Date/Time:             2016-10-03 14:10:04.915 +0300
OS Version:            Mac OS X 10.12 (16A323)
Report Version:        12
Anonymous UUID:        624C8F20-CA48-4915-59CD-DE6757A27CC3


Time Awake Since Boot: 4300 seconds

System Integrity Protection: enabled

Crashed Thread:        0  AppKit Thread  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_INSTRUCTION (SIGABRT)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
Crashing on exception: java.lang.NullPointerException
    at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:1090)
    at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:1085)
    at sun.awt.SunToolkit.getSystemEventQueueImpl(SunToolkit.java:1080)
    at java.awt.Toolkit.getEventQueue(Toolkit.java:1734)
    at java.awt.EventQueue.invokeLater(EventQueue.java:1266)
    at sun.plugin2.main.client.MacOSXKeyHandler.notifyFlagsChangedFromNative(Unknown Source)

abort() called

and etc... I disable "safe mode" in preferances, but this won't help. Anyone has solution for this? Java 8 udate 101. tnx


Answer:

I solved my issues by downloading a pre-release of Java. I was having trouble with Attachmate's Reflection for the web. The Java bugs seem to be corrected in Version 8 Update 122. Earlier, I had tried Version 9, but it seemed a little buggy.

Question:

Our java applet sometimes hangs when working with dialog on Mac OS X 10.9.4. always with same thread dump:

"AWT-EventQueue-2" prio=5 tid=0x00007fb599138800 nid=0xbd03 runnable [0x000000010fa75000]
           java.lang.Thread.State: RUNNABLE
            at sun.lwawt.macosx.CAccessible.selectionChanged(Native Method)
            at sun.lwawt.macosx.CAccessible.access$300(CAccessible.java:44)
            at sun.lwawt.macosx.CAccessible$AXTextChangeNotifier.caretUpdate(CAccessible.java:138)
            at javax.swing.text.JTextComponent.fireCaretUpdate(JTextComponent.java:407)
            at javax.swing.text.JTextComponent$MutableCaretEvent.fire(JTextComponent.java:4417)
            at javax.swing.text.JTextComponent$MutableCaretEvent.mouseReleased(JTextComponent.java:4473)
            at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
            at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
            at java.awt.Component.processMouseEvent(Component.java:6516)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3320)
            at java.awt.Component.processEvent(Component.java:6281)
            at java.awt.Container.processEvent(Container.java:2229)
            at java.awt.Component.dispatchEventImpl(Component.java:4872)
            at java.awt.Container.dispatchEventImpl(Container.java:2287)
            at java.awt.Component.dispatchEvent(Component.java:4698)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
            at java.awt.Container.dispatchEventImpl(Container.java:2273)
            at java.awt.Window.dispatchEventImpl(Window.java:2719)
            at java.awt.Component.dispatchEvent(Component.java:4698)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
            at java.awt.EventQueue.access$200(EventQueue.java:103)
            at java.awt.EventQueue$3.run(EventQueue.java:694)
            at java.awt.EventQueue$3.run(EventQueue.java:692)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
            at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
            at java.awt.EventQueue$4.run(EventQueue.java:708)
            at java.awt.EventQueue$4.run(EventQueue.java:706)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:154)
            at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
            at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
            at java.awt.Dialog.show(Dialog.java:1082)
            at java.awt.Component.show(Component.java:1655)
            at java.awt.Component.setVisible(Component.java:1607)
            at java.awt.Window.setVisible(Window.java:1014)
            at java.awt.Dialog.setVisible(Dialog.java:1005)

    "RMI TCP Connection(11)-127.0.0.1" daemon prio=5 tid=0x00007fb59989a800 nid=0x11f03 runnable [0x000000011a78f000]
       java.lang.Thread.State: RUNNABLE
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:152)
        at java.net.SocketInputStream.read(SocketInputStream.java:122)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
        - locked <0x00000007f61dbab8> (a java.io.BufferedInputStream)
        at java.io.FilterInputStream.read(FilterInputStream.java:83)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:538)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

       Locked ownable synchronizers:
        - <0x00000007fecbf608> (a java.util.concurrent.ThreadPoolExecutor$Worker)

    "RMI TCP Connection(9)-127.0.0.1" daemon prio=5 tid=0x00007fb599404800 nid=0x11d03 runnable [0x000000011a68c000]
       java.lang.Thread.State: RUNNABLE
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:152)
        at java.net.SocketInputStream.read(SocketInputStream.java:122)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
        - locked <0x00000007f635acf0> (a java.io.BufferedInputStream)
        at java.io.FilterInputStream.read(FilterInputStream.java:83)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:538)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

       Locked ownable synchronizers:
        - <0x00000007fecc0c90> (a java.util.concurrent.ThreadPoolExecutor$Worker)

    "RMI TCP Accept-0" daemon prio=5 tid=0x00007fb59cb8a000 nid=0xdb4f runnable [0x0000000117eb6000]
       java.lang.Thread.State: RUNNABLE
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
        at java.net.ServerSocket.implAccept(ServerSocket.java:530)
        at java.net.ServerSocket.accept(ServerSocket.java:498)
        at sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(LocalRMIServerSocketFactory.java:52)
        at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:388)
        at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:360)
        at java.lang.Thread.run(Thread.java:745)

       Locked ownable synchronizers:
        - None

    "Java Plug-In Pipe Worker Thread (Client-Side)" daemon prio=5 tid=0x00007fb59a137800 nid=0xab07 runnable [0x000000010f0f8000]
       java.lang.Thread.State: RUNNABLE
        at com.sun.deploy.net.socket.UnixSocketImpl.unStreamSocketRead(Native Method)
        at com.sun.deploy.net.socket.UnixDomainSocket.read(Unknown Source)
        at com.sun.deploy.net.socket.UnixDomainSocket.read(Unknown Source)
        at sun.plugin2.ipc.unix.DomainSocketNamedPipe.read(Unknown Source)
        at sun.plugin2.message.transport.NamedPipeTransport$SerializerImpl.read(Unknown Source)
        at sun.plugin2.message.transport.NamedPipeTransport$SerializerImpl.readByte(Unknown Source)
        at sun.plugin2.message.AbstractSerializer.readInt(Unknown Source)
        at sun.plugin2.message.transport.SerializingTransport.read(Unknown Source)
        at sun.plugin2.message.Pipe$WorkerThread.run(Unknown Source)

       Locked ownable synchronizers:
        - None

    "AppKit Thread" daemon prio=5 tid=0x00007fb5990b0800 nid=0xd07 runnable [0x00007fff5e484000]
       java.lang.Thread.State: RUNNABLE
        at sun.lwawt.macosx.LWCToolkit.doAWTRunLoop(Native Method)
        at sun.lwawt.macosx.LWCToolkit.invokeAndWait(LWCToolkit.java:570)
        at sun.lwawt.macosx.LWCToolkit.invokeAndWait(LWCToolkit.java:511)
        at sun.lwawt.macosx.CAccessibility.invokeAndWait(CAccessibility.java:75)
        at sun.lwawt.macosx.CAccessibility.accessibilityHitTest(CAccessibility.java:388)

       Locked ownable synchronizers:
        - None

It hangs in Native method CAccessible.selectionChanged().

Hangs are unpredictable but always when user work with dialogs. Hangs start from Java 7 Update 55, older java versions or other OS (windows, linux) run without this problem.

OS = Mac OS X 10.9.4

Java = started at Java 7u55, simulated at 7u67 and Java 8 as well.

I can't find anything for this issue, any help ? Thank you...


Answer:

Ran into this problem in Java 8u65. Came across this standing OpenJDK ticket:

https://bugs.openjdk.java.net/browse/JDK-8068222

The comments of the bug report mention that the issue might arise from OSX's VoiceOver accessibility feature. Disabling voiceover does nothing to resolve the issue and thread locks continue to occur, eventually locking up the application completely.

However, with further searching, I came across this SO question which hinted at possible issues with application accessibility issues. I followed the answer in that post and disabled all the applications in System Preferences > Security & Privacy > Accessibility and did not incur the error again. I was able to identify the problematic application by re-enabling applications one by one and testing over time. Not an ideal solution, but a functional workaround in my case.

Question:

I have the latest java by now 1.8.0_25 on my mac. version checker says it's fine. But I 'm getting this error

If I click 'Later' it works, but then appears again later. I see this almost since the release of 1.8. I also have jdk1.7 and 1.6(apple) installed. enter image description here


Answer:

I had the exact same problem for the longest time. No old Java VM showed up in the system preferences. I eventually found and old JDK in /Library/Java/JavaVirtualMachines.

Check in the following locations for "old" VMs:

find /Library -name '*java*'
find /System/Library -name '*java*'
find ~/Library -name '*java*'

Question:

Display mode settings : fullscreen.displaywidth =(1440,900,16,0)

Current display resolution: 1440*900 scaled.

Code :

fullscreen.pixelperframe = ((fullscreen.speed - 10) > 1) ? (fullscreen.speed-10) : 1;   
DisplayMode dmode = new DisplayMode(fullscreen.displaywidth,fullscreen.displayheight,16,0);    

Exception in thread "main" java.lang.IllegalArgumentException: Invalid display mode at sun.awt.CGraphicsDevice.nativeSetDisplayMode(Native Method) at sun.awt.CGraphicsDevice.setDisplayMode(CGraphicsDevice.java:234) at FullScreen.main(FullScreen.java:237)

System Macbook Air 2012

MyQuestion :

What is the proper display mode settings that work in Macbook Air , or the code should be different.


Answer:

You can use GraphicsDevice#getDisplayModes to list the available DisplayModes that a device can support, for example

GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gd = ge.getDefaultScreenDevice();
for (DisplayMode dm : gd.getDisplayModes()) {
    System.out.println(dm.getWidth() + "x" + dm.getHeight() + "@" + dm.getRefreshRate());
}

Which on mini-mac outputs...

2560x1600@32
1280x1024@75
1024x768@75
1024x768@60
800x600@75
800x600@60
640x480@75
640x480@60
1280x1024@60
1600x1200@60
640x480@85
800x600@85
848x480@60
1024x768@85
1280x960@60
1280x960@75
1280x960@85
1280x1024@85
1360x768@60
1920x1080@60
1280x800@32
800x500@32
1024x640@32
1344x1008@32
1344x840@32
1600x1000@32
2048x1280@32