Modify

Opened 11 years ago

Closed 10 years ago

Last modified 8 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 (2)

Change_Mac_OS_X_application_bundle_creation_to_app_bundler.patch (4.9 KB ) - added by mark0815 11 years ago.
8654_draft.patch (3.4 KB ) - added by Don-vip 11 years ago.

Download all attachments as: .zip

Change History (50)

comment:1 by mark0815, 11 years ago

Description: modified (diff)

comment:2 by mark0815, 11 years ago

Description: modified (diff)

comment:3 by Don-vip, 11 years ago

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 by Don-vip, 11 years ago

Keywords: java7 added

comment:5 by mark0815, 11 years ago

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 by stoecker, 11 years ago

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 by stoecker, 11 years ago

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

comment:8 by stoecker, 11 years ago

See also #8764.

comment:9 by Don-vip, 11 years ago

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

comment:10 by Don-vip, 11 years ago

Cc: Stereo added

comment:11 by Don-vip, 11 years ago

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 by Don-vip, 11 years ago

Owner: changed from Radfahrer to team

by Don-vip, 11 years ago

Attachment: 8654_draft.patch added

comment:13 by Don-vip, 11 years ago

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 by Don-vip, 11 years ago

In 6216/josm:

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

comment:15 by Don-vip, 11 years ago

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 by Don-vip, 11 years ago

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

comment:17 by Don-vip, 11 years ago

Cc: elchtreiber@… cquest added

comment:18 by Don-vip, 11 years ago

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 by anonymous, 11 years ago

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 by anonymous, 11 years ago

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

comment:21 by Stereo, 11 years ago

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

comment:22 by Don-vip, 11 years ago

In 6217/josm:

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

in reply to:  20 comment:23 by Don-vip, 11 years ago

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 by Don-vip, 11 years ago

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 by Don-vip, 11 years ago

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

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

comment:26 by Don-vip, 10 years ago

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

comment:27 by Don-vip, 10 years ago

Cc: malcolmh added

comment:28 by Don-vip, 10 years ago

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 by malcolmh, 10 years ago

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

comment:30 by Stereo, 10 years ago

@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 10 years ago by Don-vip (previous) (diff)

comment:31 by cquest, 10 years ago

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 by malcolmh, 10 years ago

A quick check confirms the problem on my system.

comment:33 by Don-vip, 10 years ago

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 by Don-vip, 10 years ago

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 ?

in reply to:  34 comment:36 by anonymous, 10 years ago

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 by Don-vip, 10 years ago

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

in reply to:  37 comment:38 by anonymous, 10 years ago

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 by Don-vip, 10 years ago

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 8 years ago by Don-vip (previous) (diff)

comment:40 by Don-vip, 10 years ago

Milestone: 14.02

comment:41 by Don-vip, 10 years ago

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 by brycenesbitt, 10 years ago

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 by Don-vip, 10 years ago

In 6945/josm:

see #8654 - refactor Mac OSX packaging ant task

comment:44 by Don-vip, 10 years ago

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 by Don-vip, 10 years ago

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

comment:46 by Don-vip, 10 years ago

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 by Stereo, 10 years ago

Hi Don-vip,

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

comment:48 by Stereo, 10 years ago

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. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.