Help with Configuring Maven and Java on osx

Post Reply New Topic
RELATED
PRODUCTS

Post

I'm getting come compile errors when doing : mvn install. Thought I would log it here in case someone else ran into the same stuff. I'm going to try a new script from the bitwig helper and look into this deeper.

Java version...
slomocorp@slomocorps-mbp My First Java % java -version
java version "1.8.0_261"
Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode)
MVN
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /Users/slomocorp/apache-maven-3.6.3
Java version: 1.8.0_261, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.15.6", arch: "x86_64", family: "mac"
Error... I did the -e switch but it just says compiler error basically.

Code: Select all

Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode)
slomocorp@slomocorps-mbp My First Java % mvn install   
[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------< com.kirkwoodwest:MyFirstJavaExtension >----------------
[INFO] Building My First Java 0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ MyFirstJavaExtension ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ MyFirstJavaExtension ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /Users/slomocorp/Documents/Bitwig Studio/Controller Scripts/My First Java/target/classes
[WARNING] Unable to autodetect 'javac' path, using 'javac' from the environment.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.518 s
[INFO] Finished at: 2020-09-25T12:47:31-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project MyFirstJavaExtension: Compilation failure -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
----------------------------------------------------------------------
http://instagram.com/kirkwoodwest/
http://soundcloud.com/kirkwoodwest

Post

mvn with -e...Still just a seemingly random compile problem.
slomocorp@slomocorps-mbp My First Java % mvn install -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------< com.kirkwoodwest:MyFirstJavaExtension >----------------
[INFO] Building My First Java 0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ MyFirstJavaExtension ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ MyFirstJavaExtension ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /Users/slomocorp/Documents/Bitwig Studio/Controller Scripts/My First Java/target/classes
[WARNING] Unable to autodetect 'javac' path, using 'javac' from the environment.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.106 s
[INFO] Finished at: 2020-09-25T13:47:34-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project MyFirstJavaExtension: Compilation failure -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project MyFirstJavaExtension: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1219)
at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:188)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/disp ... eException
----------------------------------------------------------------------
http://instagram.com/kirkwoodwest/
http://soundcloud.com/kirkwoodwest

Post

ok... so I'm getting rolling now. It seems like i was using the incorrect JDK!?!? Even thought it says 1.8, I tried everything in my power to try to get that JDK to work.

I ended up using Oracle Open JDK 15. which seems to compile with maven fine. Can't explain this! but yeah the specification in mosses tutorial said to use 1.8 and even the versions line up in his commands before executing the mvn install. But maybe I got this wrong.

Thanks JakeXY for bringing up this old thread, using a gui like this was pretty simple to set up.
viewtopic.php?f=268&t=492947
----------------------------------------------------------------------
http://instagram.com/kirkwoodwest/
http://soundcloud.com/kirkwoodwest

Post

Ok... finally got the debugger working. Took me a long time to figure out how to set up the BITWIG_DEBUG_PORT in the environment variables for osx and on top of that Catalina is different thatn previous versions as it uses zsh instead of sh. I'll make a follow up post in the next couple days outlining my finds for further reference.
----------------------------------------------------------------------
http://instagram.com/kirkwoodwest/
http://soundcloud.com/kirkwoodwest

Post

Current Bitwig version uses JDK 12. To be on the safe side you should use the same:

Code: Select all

https://adoptopenjdk.net/releases.html?variant=openjdk12&jvmVariant=hotspot
You can always confirm if you go to the Bitwig JRE directory, e.g.

Code: Select all

C:\Program Files\Bitwig Studio\3.2.8\jre\bin
and type

Code: Select all

java -version

Post

moss wrote: Sun Sep 27, 2020 8:57 am Current Bitwig version uses JDK 12. To be on the safe side you should use the same:

Code: Select all

https://adoptopenjdk.net/releases.html?variant=openjdk12&jvmVariant=hotspot
You can always confirm if you go to the Bitwig JRE directory, e.g.

Code: Select all

C:\Program Files\Bitwig Studio\3.2.8\jre\bin
and type

Code: Select all

java -version
Thanks for the details Moss! Things are quite different on mac so Just setting the Java and environment variables seems to be much different than pc and require use of terminal. There are also differences between Catalina and previous versions because it bash is now zsh. I'm still not configured perfectly but I have enough to get started.

For example... To set the debug port for gui apps this can be run in terminal. Then every time you run bitwig from the app launcher it will set the debug port proper.

Code: Select all

launchctl setenv BITWIG_DEBUG_PORT 5005
I can't seem to figure out where to add it so this gets executed every time bitwig runs or i log into the profile...

.zprofile and zshrc seem to be good candidates for setting the path in OSX Catalina. eg....
Added this to .zshrc

Code: Select all

export PATH=$PATH:Library/Java/JavaVirtualMachines/openjdk-15/Contents/Home
and then in .zprofile:

Code: Select all

source ~/.zshrc
I hope to clarify this in the future for anyone else that comes along but I'm just not experienced enough to know the answers perfectly.
----------------------------------------------------------------------
http://instagram.com/kirkwoodwest/
http://soundcloud.com/kirkwoodwest

Post

Macos is just a nightmare and it is getting worse and worse...
Kirkwood West wrote: Mon Sep 28, 2020 9:43 pm I can't seem to figure out where to add it so this gets executed every time bitwig runs or i log into the profile...
I wasted a lot of time on this as well and couldn't find a solution. I think it might not be possible at all.
I did it the following way:
1) Added "export BITWIG_DEBUG_PORT=5005" to .zprofile
2) Run Bitwig from the zsh shell to make it pick up the setting:
/Applications/Bitwig Studio.app/Contents/MacOS/BitwigStudio
I guess you could create a link for that.

Post

I did not mean for you to waste time on this moss! but thank you! :D
----------------------------------------------------------------------
http://instagram.com/kirkwoodwest/
http://soundcloud.com/kirkwoodwest

Post

Kirkwood West wrote: Tue Sep 29, 2020 4:00 pm I did not mean for you to waste time on this moss! but thank you! :D
Don't worry, I did this already some time ago since I need to test on all 3 platforms :-)

Post

awesome. I guess that is part of why we are on this forum. Although you are probably the main source of help here :D. We will come together to find the solution! :)
----------------------------------------------------------------------
http://instagram.com/kirkwoodwest/
http://soundcloud.com/kirkwoodwest

Post

Ok... found some details about how to make this work with the Apple Launcher.

http://www.dowdandassociates.com/blog/c ... chd-plist/

I went ahead and made a .plist file where you can unzip and place here in the LaunchAgents folder. The debug port is set to 5005 but if you are coding you can probably figure out how to find and replace that.

/Library/LaunchAgents/bitwig.plist

Disclaimer: Feel free to use at your own risk. I take no responsibility for the use of this software or the damages it does to your computer.
You do not have the required permissions to view the files attached to this post.
----------------------------------------------------------------------
http://instagram.com/kirkwoodwest/
http://soundcloud.com/kirkwoodwest

Post

Another way to attach the debugger to Bitwig is to create an automator script which run the shell command

Code: Select all

launchctl setenv BITWIG_DEBUG_PORT 5005
and then launch Bitwig afterwards.
If you create this as Application then you can run it directly from the launcher.
You do not have the required permissions to view the files attached to this post.

Post

No?Ya @ Delta9 wrote: Tue Dec 22, 2020 2:15 pm Another way to attach...
Grande NoYa che anche tu sei qua!!! :tu:

GigiStampo

Post Reply

Return to “Controller Scripting”