Modify

Opened 6 years ago

Closed 5 years ago

Last modified 3 years ago

#8654 closed enhancement (fixed)

Create Mac OS X application bundle which uses Java 1.7 on 10.8

Reported by: mark0815 Owned by: team
Priority: critical Milestone: 14.03
Component: Installer MacOS Version:
Keywords: java7 javabug Cc: Stereo, elchtreiber@…, cquest, malcolmh

Description (last modified by mark0815)

The current version of JOSM displays a deprecation warning after startup saying that Java 1.6 is deprecated though Java 1.7 is installed too.

Attached is a patch utilising an enhanced version of the oracle java app builder to build the JOSM application bundle instead of using the JOSM.app-template. Additionally the Runtime is copied into the application bundle to run JOSM without having Java installed.

Due to my lack of knowledge how to create a patch which contains binary data :-) some changes have to made manually:

  • Place appbundler-1.0ea.jar in tools
  • Move macosx/JOSM.app/Contents/Resources/JOSM.icns to macosx/JOSM.icns
  • Delete macosx/JOSM.app

Attachments (4)

Change_Mac_OS_X_application_bundle_creation_to_app_bundler.patch (4.9 KB) - added by mark0815 6 years ago.
appbundler-1.0ea.jar (138.8 KB) - added by mark0815 6 years ago.
Should be placed in "tools"
appbundler-1.0ea-2013-08-15.jar (128.4 KB) - added by Don-vip 5 years ago.
new version
8654_draft.patch (3.4 KB) - added by Don-vip 5 years ago.

Download all attachments as: .zip

Change History (52)

Changed 6 years ago by mark0815

Attachment: appbundler-1.0ea.jar added

Should be placed in "tools"

comment:1 Changed 6 years ago by mark0815

Description: modified (diff)

comment:2 Changed 6 years ago by mark0815

Description: modified (diff)

comment:3 Changed 6 years ago by Don-vip

Thanks for the patch. Could you just tell us where does this application bundle come from ? (so we can update later if necessary)

comment:4 Changed 6 years ago by Don-vip

Keywords: java7 added

comment:5 Changed 6 years ago by mark0815

This one:

https://bitbucket.org/infinitekind/appbundler

It's a fork of the app bundler mentioned above which adds some enhancements to the original version.

comment:6 Changed 6 years ago by stoecker

Following perl code creates the mac installer, not the ant task:

      print "New mac installer $rev.\n";
      system "rm -rfv $imac 2>/dev/null";
      mkdir $imac;
      chdir $imac;
      cpr("$core/CONTRIBUTION","$core/README","$core/LICENSE","$core/macosx/JOSM.app",".");
      my $plist=`/bin/cat $core/macosx/JOSM.app/Contents/Info.plist`;
      $plist =~ s/\@SVNVersion\@/$rev/;
      $plist =~ s/josm-custom\.jar/$jar/;
      open FILE,">","JOSM.app/Contents/Info.plist" or die;
      print FILE $plist;
      close FILE;
      cpr($pjar,"JOSM.app/Contents/Resources/Java/");
      system 'find -name "*.svn" -printf "rm -rf %p\n"|sh';
      system "zip -9qr $mac *";
      mv $mac,$macpath;
      ln $mac,$pmacln;
      chdir $home;
      system "rm -rfv $imac 2>/dev/null";

comment:7 Changed 6 years ago by stoecker

Ticket #8739 has been marked as a duplicate of this ticket.

comment:8 Changed 6 years ago by stoecker

See also #8764.

comment:9 Changed 6 years ago by Don-vip

Ticket #8871 has been marked as a duplicate of this ticket.

comment:10 Changed 6 years ago by Don-vip

Cc: Stereo added

comment:11 Changed 5 years ago by Don-vip

Summary: Create Mac OS X application bundle which uses Java 1.7 on 10.8[patch] Create Mac OS X application bundle which uses Java 1.7 on 10.8

In fact we need to implement this if we want Mac users to switch for Java 7 before we switch JOSM itself (see #9035: I did not understand that our current package cannot be used with Java 7 !)

comment:12 Changed 5 years ago by Don-vip

Owner: changed from Radfahrer to team

Changed 5 years ago by Don-vip

new version

Changed 5 years ago by Don-vip

Attachment: 8654_draft.patch added

comment:13 Changed 5 years ago by Don-vip

I'm trying to implement this (see patch and updated jar) but always face NPE, can someone help me ?

BUILD FAILED
build.xml:130: java.lang.NullPointerException
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:116)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:392)
	at org.apache.tools.ant.Target.performTasks(Target.java:413)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
	at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
	at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
Caused by: java.lang.NullPointerException
	at com.oracle.appbundler.AppBundlerTask.copy(AppBundlerTask.java:709)
	at com.oracle.appbundler.AppBundlerTask.execute(AppBundlerTask.java:333)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	... 10 more

comment:14 Changed 5 years ago by Don-vip

In 6216/josm:

see #8654 - New target distmac7 to build Mac OS X package for Oracle Java 7

comment:15 Changed 5 years ago by Don-vip

Summary: [patch] Create Mac OS X application bundle which uses Java 1.7 on 10.8Create Mac OS X application bundle which uses Java 1.7 on 10.8

comment:16 Changed 5 years ago by Don-vip

Ticket #9035 has been marked as a duplicate of this ticket.

comment:17 Changed 5 years ago by Don-vip

Cc: elchtreiber@… cquest added

comment:18 Changed 5 years ago by Don-vip

Hi guys, could you please test this package:

http://donvip.fr/jenkins/job/JOSM/lastSuccessfulBuild/artifact/dist/josm-custom-macosx-java7.zip

And tell us:

  • if it works :)
  • if it uses Oracle Java 7 (as shown in status report)

Thanks

comment:19 Changed 5 years ago by anonymous

It works :)
Java 7 is indeed used (no report about switching to Java 7 in the welcome text), confirmed in the "About JOSM" dialog.

\o/

comment:20 Changed 5 years ago by anonymous

It runs, but as a regression, the keyboard shortcuts all seem to be in QWERTY.

comment:21 Changed 5 years ago by Stereo

Also, the Java 7 build seems to take up a lot of CPU when compared to the Java 6 build.

comment:22 Changed 5 years ago by Don-vip

In 6217/josm:

see #8654 - Make Mac OS X Java 7 package closer to former package

comment:23 in reply to:  20 Changed 5 years ago by Don-vip

Replying to anonymous:

It runs, but as a regression, the keyboard shortcuts all seem to be in QWERTY.

Thanks for the test. Can you please:

comment:24 Changed 5 years ago by Don-vip

Can you please check you're running latest version of Java 7 (7u25) and post here your status report ?
7u40-ea might be worth a try too:
https://jdk7.java.net/download.html

comment:25 Changed 5 years ago by Don-vip

@Stereo: Java 7u40 has been released, can you please give it a try ? Thanks.

Last edited 5 years ago by Don-vip (previous) (diff)

comment:26 Changed 5 years ago by Don-vip

Ticket #9225 has been marked as a duplicate of this ticket.

comment:27 Changed 5 years ago by Don-vip

Cc: malcolmh added

comment:28 Changed 5 years ago by Don-vip

Up to all users running Mac OS X 10.8/10.9: can you please install latest version of Java 7 (7u45 right now), test this package and report your feedback:
http://donvip.fr/jenkins/job/JOSM/lastSuccessfulBuild/artifact/dist/josm-custom-macosx-java7.zip

If it works fine we will provide it officially.

comment:29 Changed 5 years ago by malcolmh

Tested on two different systems running 10.9. Worked fine on both - thanks!

comment:30 Changed 5 years ago by Stereo

@Don-vip I'm still getting the ctrl-something shortcuts in qwerty.

Here's my status report:

Build-Date: 2013-10-23 20:16:44
Revision: 6321
Is-Local-Build: true

Identification: JOSM/1.5 (6321 SVN en_GB) Mac OS X 10.9
Memory Usage: 260 MB / 455 MB (147 MB allocated, but free)
Java version: 1.7.0_45, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
VM arguments: [-Djava.library.path=/Applications/JOSM.app/Contents/MacOS, -DLibraryDirectory=/Users/stereo/Library, -DDocumentsDirectory=/Users/stereo/Documents, -DApplicationSupportDirectory=/Users/stereo/Library/Application Support, -DCachesDirectory=/Users/stereo/Library/Caches, -DSandboxEnabled=false, -Xmx512m, -Dapple.laf.useScreenMenuBar=true, -Dcom.apple.macos.use-file-dialog-packages=true, -Dcom.apple.macos.useScreenMenuBar=true, -Dcom.apple.mrj.application.apple.menu.about.name=JOSM, -Dcom.apple.smallTabs=true]
Dataset consistency test: No problems found

Plugin: AddrInterpolation (29854)
Plugin: CommandLine (29854)
Plugin: DirectDownload (29854)
Plugin: DirectUpload (30017)
Plugin: FixAddresses (29971)
Plugin: HouseNumberTaggingTool (29854)
Plugin: OpeningHoursEditor (29854)
Plugin: PicLayer (29854)
Plugin: RoadSigns (29854)
Plugin: buildings_tools (30010)
Plugin: cadastre-fr (29934)
Plugin: conflation (0.1.6)
Plugin: contourmerge (1009)
Plugin: dataimport (29854)
Plugin: download_along (30017)
Plugin: geotools (29767)
Plugin: importvec (29854)
Plugin: jts (29854)
Plugin: livegps (29854)
Plugin: mapdust (29854)
Plugin: merge-overlap (29854)
Plugin: namemanager (29930)
Plugin: opendata (30017)
Plugin: openstreetbugs (30004)
Plugin: pdfimport (29913)
Plugin: public_transport (29862)
Plugin: reverter (30017)
Plugin: scripting (30560)
Plugin: surveyor (29854)
Plugin: tageditor (29854)
Plugin: terracer (29854)
Plugin: todo (29155)
Plugin: turnlanes (29854)
Plugin: turnrestrictions (29854)
Plugin: undelete (29854)
Plugin: utilsplugin2 (30017)
Plugin: wayselector (29854)
Last edited 5 years ago by Don-vip (previous) (diff)

comment:31 Changed 5 years ago by cquest

With the previous Java7 bundle don-vip sent me (I'll check with the last one asap), keyboard modifiers (control, option, command, shift) are not handled properly meaning that most shortcuts do not work as expected or do not work at all.

comment:32 Changed 5 years ago by malcolmh

A quick check confirms the problem on my system.

comment:33 Changed 5 years ago by Don-vip

Priority: normalcritical

Priority increased as it currently blocks any plan to switch to Java 7.

We made some tests with cquest today. Here the results:

  • Standard input: OK (French keyboard layout AZERTY is respected. Typing an A gives an A :)
  • One-letter shortcuts: OK (Q)
  • Ctrl-letter: Bug (Ctrl-Z triggers Ctrl-W. The keyboard layout appears to be QWERTY)
  • Alt-letter: Bug (Alt-Q triggers Alt-A)
  • Shift-letter: OK (Shift-A)
  • Ctrl-Shift-letter seems OK
  • Alt-Shift-letter: Bug
  • Ctrl-Alt-Shift-letter: Bug

It's very weird I don't understand right now.

comment:34 Changed 5 years ago by Don-vip

I have found a similar bug in JavaFX but not (yet ?) in JDK: https://javafx-jira.kenai.com/browse/RT-30669

@malcolmh: are you using an AZERTY keyboard too ?

comment:36 in reply to:  34 Changed 5 years ago by anonymous

Replying to Don-vip:

I have found a similar bug in JavaFX but not (yet ?) in JDK: https://javafx-jira.kenai.com/browse/RT-30669

@malcolmh: are you using an AZERTY keyboard too ?

No - mine is a UK QWERTY

comment:37 Changed 5 years ago by Don-vip

QWERTY ? Then what is your problem ? We're talking about shortcuts treated as QWERTY on non-QWERTY keyboards :)

comment:38 in reply to:  37 Changed 5 years ago by anonymous

Replying to Don-vip:

QWERTY ? Then what is your problem ? We're talking about shortcuts treated as QWERTY on non-QWERTY keyboards :)

OK, so maybe I don't have a problem. I did not notice that Alt-F had changed to Cmd-M since 6238.

comment:39 Changed 5 years ago by Don-vip

As I really don't see how to implement a workaround and the two bugs I have listed are targeted to Java 9, I have filed a new bug (https://bugs.openjdk.java.net/browse/JI-9008003), I hope this one will be backported to the next JDK7 update...

Last edited 3 years ago by Don-vip (previous) (diff)

comment:40 Changed 5 years ago by Don-vip

Milestone: 14.02

comment:41 Changed 5 years ago by Don-vip

Milestone: 14.0214.03

There are still too much Mac OSX bugs in Java 7 to propose this new bundle as default. I prefer to wait for release of Java 8 in March.

comment:42 Changed 5 years ago by brycenesbitt

I tried josm on OS X 10.9 today, under the Java 7 7u51 JRE.
Contrary to: http://wiki.openstreetmap.org/wiki/JOSM/Mac
it worked.

However: paste into JOSM was not functional,
and the DELETE key and other keybindings don't work.

comment:43 Changed 5 years ago by Don-vip

In 6945/josm:

see #8654 - refactor Mac OSX packaging ant task

comment:44 Changed 5 years ago by Don-vip

Resolution: fixed
Status: newclosed

The next Mac OS X package will use Java 7. A legacy Java 6 package will still be produced until we switch to Java 7 only.

comment:45 Changed 5 years ago by Don-vip

Ticket #9883 has been marked as a duplicate of this ticket.

comment:46 Changed 5 years ago by Don-vip

Keywords: javabug added

Hi guys,
Can you upgrade to Java 7u60? It does not look like to solve the previously stated problems (8022079 and 8019498), but it contains fixes for the following macosx ones:

  • 7129133: Accelerators are displayed as Meta instead of the Command symbol
  • 8011194: Apps launched via double-clicked .jars have file.encoding value of US-ASCII on Mac OS X
  • 8022997: Remaining duplicated key events

comment:47 Changed 5 years ago by Stereo

Hi Don-vip,

I've upgraded to 7u60, and can't see any difference for our issues.

comment:48 Changed 4 years ago by Stereo

This is fixed in Java 8u20. I can confirm that it works.

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.