question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I can't run " maestro test {path of file yaml} " after install Java for iOS Developer

See original GitHub issue

I download java because when run maestro test /Users/paponsupamongkonchai/MaestroYAML/flow_ios_test.yaml first time log of terminal introduce downlod Java for run command of maestro

Then download and install Java so I run again in terminal maestro test /Users/paponsupamongkonchai/MaestroYAML/flow_ios_test.yaml it’s show this message about version Java not support in Java version 55.0

=======See Log Below=======

paponsupamongkonchai@Papons-MacBook-Pro ~ % maestro test /Users/paponsupamongkonchai/MaestroYAML/flow_ios_test.yaml
Exception in thread "main" java.lang.UnsupportedClassVersionError: idb/CompanionServiceGrpc has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	at ios.idb.IdbIOSDevice.<init>(IdbIOSDevice.kt:58)
	at maestro.Maestro$Companion.ios(Maestro.kt:291)
	at maestro.Maestro$Companion.ios(Maestro.kt:287)
	at maestro.cli.util.MaestroFactory.createIos(MaestroFactory.kt:58)
	at maestro.cli.util.MaestroFactory.autoDetectPlatform(MaestroFactory.kt:66)
	at maestro.cli.util.MaestroFactory.createMaestro(MaestroFactory.kt:33)
	at maestro.cli.command.TestCommand.call(TestCommand.kt:58)
	at maestro.cli.command.TestCommand.call(TestCommand.kt:30)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1933)
	at picocli.CommandLine.access$1200(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159)
	at picocli.CommandLine.execute(CommandLine.java:2058)
	at maestro.cli.AppKt.main(App.kt:74)

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
JARNBOYcommented, Sep 7, 2022

Finally I found solution fix this problem by change default java version. you can see solution in this Blog(https://medium.com/miro-engineering/how-to-switch-between-java-lts-versions-8-11-and-17-on-mac-cb6717d1272)

I will show you step by step for another had same issue after you download java.dmg from website .

  1. open terminal
  2. paste brew install java -> until download success -> ok next.
  3. paste brew install openjdk -> it’s install lastest jdk
  4. check version java -version -> if you see old version in my case show version old is1.8.0._ -> ok next.
  5. paste code this for change default java
# version 18
brew install openjdk@18
sudo ln -sfn /usr/local/opt/openjdk@18/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-18.jdk

# version 17
brew install openjdk@17
sudo ln -sfn /usr/local/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk

# version 11
brew install openjdk@11
sudo ln -sfn /usr/local/opt/openjdk@11/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-11.jdk

# version 8
brew install openjdk@8
sudo ln -sfn /usr/local/opt/openjdk@8/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-8.jdk
  1. when install all is success you paste this
javahome() {
  unset JAVA_HOME 
  export JAVA_HOME=$(/usr/libexec/java_home -v "$1");
  java -version
}
alias j1.8='javahome 1.8'
alias j11='javahome 11'
alias j17='javahome 17'
alias j18='javahome 18’

7.when enter done you paste this when install all is success you paste this

$ j18
openjdk version "18.0.2.1" 2022-09-07
OpenJDK Runtime Environment Homebrew (build 18.0.1+0)
OpenJDK 64-Bit Server VM Homebrew (build 18.0.1+0, mixed mode, sharing)
$ j17
openjdk version "17.0.1" 2021-10-19
OpenJDK Runtime Environment Homebrew (build 17.0.1+0)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.1+0, mixed mode, sharing)
$ j11
openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment Homebrew (build 11.0.12+0)
OpenJDK 64-Bit Server VM Homebrew (build 11.0.12+0, mixed mode)
$ j1.8
openjdk version "1.8.0_312"
OpenJDK Runtime Environment (build 1.8.0_312-bre_2021_10_20_23_15-b00)
OpenJDK 64-Bit Server VM (build 25.312-b00, mixed mode)
  1. Set java_home if you never set for MacOS can select device current youcan see in (https://stackoverflow.com/questions/22842743/how-to-set-java-home-environment-variable-on-mac-os-x-10-9)

  2. ok you restart device Macbook

  3. try run " maestro test {path of file yaml} " again.

Screen Shot 2565-09-07 at 23 52 04
2reactions
dmitry-zaitsevcommented, Sep 6, 2022

Interesting, could you try brew install java?

Read more comments on GitHub >

github_iconTop Results From Across the Web

I can't run " maestro test {path of file yaml} " after install Java ...
I can't run " maestro test {path of file yaml} " after install Java for iOS Developer · open terminal · paste brew...
Read more >
JARNBOY (Papon) - GitHub
I can't run " maestro test {path of file yaml} " after install Java for iOS Developer ... I download java because when...
Read more >
Error running UI tests on device with iOS 16 and xctestrun file
I am able to launch the test directly from xcode, or with the "project" and "scheme" flags and xcodebuild test but I can't...
Read more >
Relative path is not working in soring-boot application.yml
I have file under test folder and accessing it in application.yml file but it's not working. FYI: Absolute path for the same is...
Read more >
Getting started with Maestro: The new mobile UI testing ...
Maestro supports native (Android and iOS) and cross-platform mobile platforms (Flutter ... 3- Open the yaml file to add the following steps:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found