Setting java aliases with zshell on Mac

When I’m working on different versions of Java, I set up a bunch of aliases so I can run commands quickly and compare differences. I recently upgraded my Mac and accepted the default shell as zshell instead of bash. (This change was made a long time ago but I didn’t upgrade for a long time because I didn’t want to incur the risk of being without my computer when everything was closed for the pandemic.)

Since I needed to move this from .bash_profile to .zshenv, I took the opportunity to shed a lot of them. I now have just Java 11 and Java 17 that I am using for comparisons. (LTS to LTS).

My .zshenv now contains this. (Yes, I know I should have patched Java 11, but alas.) I ran “source .zshenv” and am good to go.

Now I can run java11 JeanneTest.java and java17 JeanneTest.java to easily compare differences.

alias javac17=/Library/Java/JavaVirtualMachines/jdk-17-ea.jdk/Contents/Home/bin/javac
alias java17=/Library/Java/JavaVirtualMachines/jdk-17-ea.jdk/Contents/Home/bin/java
alias jar17=/Library/Java/JavaVirtualMachines/jdk-17-ea.jdk/Contents/Home/bin/jar
alias javac11=/Library/Java/JavaVirtualMachines/jdk-11.0.11.jdk/Contents/Home/bin/javac
alias java11=/Library/Java/JavaVirtualMachines/jdk-11.0.11.jdk/Contents/Home/bin/java
alias jar11=/Library/Java/JavaVirtualMachines/jdk-11.0.11.jdk/Contents/Home/bin/jar
alias jshell11=/Library/Java/JavaVirtualMachines/jdk-11.0..jdk/Contents/Home/bin/jshell
alias jdeps11=/Library/Java/JavaVirtualMachines/jdk-11.0.11.jdk/Contents/Home/bin/jdeps
alias jmod11=/Library/Java/JavaVirtualMachines/jdk-11.0.11.jdk/Contents/Home/bin/jmod

export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk-17-ea.jdk/Contents/Home"

Fix for M3D Micro+ failed to open stl modes after upgrading to High Sierra

I upgraded my Mac to High Sierra and then learned more about .NET and the Mac that I wanted to.

I got an error that there were two copies of a file:

FIFinderSyncExtensionHost is implement in both /System/Library/PrivateFrameworks/FinderKit.Framework/Versions/A/FinderKit and /System/Library/PrivateFramworks/FileProvider.framework/OverrideBundles/FinderSyncCollaborationFileProviderOveride.bundle/Contents/MacOS/FinderSyncCollaborationFileProviderOveride. Of of the two will be used. Which one is undefined.

There was an error in loading the file. Check to see the file is valid.

First thing that didn’t work

I tried to re-install Mono choosing the latest release 5.4.1. (Mono is the runtime for .NET on Mac and the M3D software uses .NET). This actually made things worse cause M3D to crash on opening. Then I rebooted and got an error that I wasn’t on the latest Mono. But I was.

Second thing that didn’t work

I tried re-installing the M3D software. I got:

The Mono Framework installed is not support. You must install the latest version to continue. Would you like to visit the Mono website to downloaded it?

The Mono Framework is a required component for this software and must be installed first.

Turns out I installed the Micro software instead of the Micro+ software. Reinstalled correct software.

Third thing that didn’t work

Then I tried downloading Visual Studio for Mac. Didn’t help.

Fourth thing that didn’t work

At this point, I decided to be more methodical. I tried running M3D at the command line to see if I could get more data:

cd /Applications/M3D.app/Contents/MacOS

./m3d

The highlight is:

2018-01-15 17:24:37.585 M3D[1127:35860] run command:/Library/Frameworks/Mono.framework/Versions/Current/Commands/mono /Applications/M3D.app/Contents/Resources/M3DGUI.exe

WARNING: The Carbon driver has not been ported to 64bits, and very few parts of Windows.Forms will work properly, or at all

There was also

Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo xcodebuild -license” and then retry this command.

I ran the command to agree to the license, but that didn’t solve my problem.

Fifth thing that didn’t work

I learned that Mono 5.4.1 defaults to 64 bit. But M3D and Carbon require 32 bit. There’s a flag “–arch=32/64” but doesn’t help with M3D so I uninstalled Mono again:

sudo rm -rf /Library/Frameworks/Mono.framework

sudo pkgutil --forget com.xamarin.mono-MDK.pkg

sudo rm -rf /etc/paths.d/mono-commands

Then I installed an older version (5.0.1) of mono. WHich got me back to the original message.

Sixth thing that didn’t work

Loading a file I’ve used before

What did work

I contacted M3D support and they gave me a workaround in just a few business hours. They suggested clicking on a recent model rather than loading through the OS. That worked fine. Then they suggested dragging the file directly from the Finder into the open UI.

That worked! I can print again. Thanks M3D.

 

zooming in on the mac

At my JavaOne Session on mutation testing, I needed to show both code and “other materials” to a large room on the Mac.

In Eclipse

Increasing the font size for the editor pane in Eclipse is easy. Cmd = makes the code bigger and Cmd – makes the code smaller.

Elsewhere

I also needed to show the problems view and the report. For this, I used the magnifying glass.

The initial set up was

  • Settings
  • Accessibility
  • Zoom
  • Check “Use Scroll gesture with modifier keys to zoom. I had mine set to control for the modifier, but you can change this.

Then I could zoom in on anything by holding control and moving two fingers away from me (up) on the trackpad.

To get rid of the magnifier is also easy; just hold control and two finger scroll down.