bugGNU Octave - Bugs: bug #53305, usejava ("awt") may fail...


bug #53305: usejava ("awt") may fail on macOS

Submitted by:  Sebastian <sschoeps>
Submitted on:  Thu 08 Mar 2018 03:28:24 PM UTC  
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: NoneAssigned to: None
Originator Name: Sebastian SchöpsOpen/Closed: Open
Release: devOperating System: Mac OS

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Fri 09 Mar 2018 03:35:27 PM UTC, comment #5:

>Do the other options (swing, jvm) provoke similar problems?
>as awt is just the first in the switch series.

No, it's only awt. Checking for Swing is fine

but AWT asks to install the old Java 1.6.

Sebastian <sschoeps>
Fri 09 Mar 2018 02:39:16 PM UTC, comment #4:

I tried the change suggested in comment #3 and I still see

even though the JVM is loaded and working:

It's only the last test in ov-java.cc that fails when it tries to execute usejava ("awt"). So for now, I've pushed this change:


Though this doesn't fix the real problem, it should allow the tests to run.

I hesitate to install a change to usejava.m that would warn about this problem on OS X systems specifically for AWT since I don't know whether there may be other parts of the java system that will fail similarly. It seems best to find a way to fix the real problem and prevent the JVM from aborting the program when a component doesn't work.

John W. Eaton <jwe>
Project Administrator
Thu 08 Mar 2018 11:44:08 PM UTC, comment #3:

One more thing to test on macOS might be to change scripts/java/module.mk

or just drop the -source and -target options entirely, to see if the bytecode compilation version has anything to do with this bug. Is it because the bytecode is compiled for Java 6 that the system is specifically trying to have Apple Java 6 installed?

Mike Miller <mtmiller>
Project Administrator
Thu 08 Mar 2018 06:54:34 PM UTC, comment #2:

The easiest but maybe kludgy fix is to enclose the contents of that case clause in an "if (! ismac) ... " block.

Do the other options (swing, jvm) provoke similar problems? as awt is just the first in the switch series.

Philip Nienhuis <philipnienhuis>
Project Member
Thu 08 Mar 2018 04:29:06 PM UTC, comment #1:

The actual code that Octave executes is in usejava.m

@Sebastian: Just to help narrow it down, can you log in to the macOS buildbot, start octave interactively, and then try each command individually to see which one is causing the dialog box?

The next question to google or search on StackOverflow for is how to correctly detect the features of a JVM. If this isn't the right way, fine, we can change it. But I don't know why it appears to work on other platforms, except possibly that they never have Apple's version of Java and always have a true version from Sun/Oracle.

Rik <rik5>
Project Administrator
Thu 08 Mar 2018 03:28:24 PM UTC, original submission:

Calling usejava ("awt") triggers a GUI dialog box to install the outdated Apple Java 1.6

It is not clear whether this dialog box is a macOS or Octave issue. Java was previously supplied by Apple (version <=1.6) and now it comes from Sun (>1.6). Sun's Java is treated on macOS like on Unix, while Apple's Java needed a special treatment for linking "-framework...".

I have compiled java code on macOS that contains awt without issues (example attached), so it seems not actually necessary to get the Java SE 6.

This issue was initially discussed at https://savannah.gnu.org/bugs/?53151.

Sebastian <sschoeps>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #43491:  test_AWT.java added by sschoeps (169B - application/octet-stream - simple JAVA source file to test AWT)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by sschoeps (Submitted the item)
  • -unavailable- added by sschoeps
  • -unavailable- added by sschoeps
  • -unavailable- added by sschoeps

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 08 Mar 2018 03:28:24 PM UTCsschoepsAttached File-=>Added test_AWT.java, #43491
      Carbon-Copy-=>Added -unavailable-
      Carbon-Copy-=>Added -unavailable-
      Carbon-Copy-=>Added -unavailable-

    Back to the top

    Powered by Savane 3.1-cleanup1