Skip to content

Wrap LXStudio Project as Application on OSX

Justin Belcher edited this page Aug 17, 2022 · 15 revisions

Export project as .jar

Eclipse-specific export

For each of LX, GLX, and LXStudio, in order:

  • Right-click LX project -> Maven -> Update Project
  • Build -> Clean
  • Right-click GLX project -> Maven -> Update Project
  • Build -> Clean
  • Right-click project -> Properties -> Java Build Path -> Source tab -> "GLX/src/main/resources" -> select "Excluded: **" and click Remove.
  • Right-click LXStudio project -> Maven -> Update Project
  • Build -> Clean

Select LXStudio project
File -> Export...
Java\Runnable JAR file
For Library Handling choose "Extract required libraries into generated JAR"
Finish

Test .jar from Terminal and approve microphone access

Open Terminal

java -XstartOnFirstThread -jar myLXStudioProject_2022-08-17a.jar

Approve microphone access when prompted by OSX! If previously denied you might be able to enable it from Settings>Security and Privacy>Microphone>Privacy tab> check Terminal. If Terminal is not in the list you'll need to reset microphone permissions for all applications and start over.

Wrap .jar as application

Add bash file to launch .jar

In the same folder as your .jar add a file lx.sh:

#!/bin/bash
cd ~
java -XstartOnFirstThread -jar myLXStudioProject_2022-08-17a.jar

Confirm it's executable in Terminal:

chmod a+x lx.sh
./lx.sh

In Finder, right-click lx.sh. Change "Open with" to Terminal.

Add .app to call bash file

Open Script Editor, choose New Document

	activate  
        do shell script "$HOME/lx.sh"  
end tell```

File->Export:  
As Application  
None of the options checked  

Settings->Users and Groups->(click user)->Login Items  
+ Add new -> browse for application


Justin note: there is likely a better way to do this, but was having issues getting the microphone permission when directly executing the application without going through Terminal.