# Transport error 202: connect failed: Connection refused

**URL:** <https://openrndr.discourse.group/t/transport-error-202-connect-failed-connection-refused/408>\
**Category:** Installation and setup\
**Created:** [August 19, 2022, 3:18pm UTC](https://openrndr.discourse.group/t/transport-error-202-connect-failed-connection-refused/408 "2022-08-19T15:18:34Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![francois](https://avatars.discourse-cdn.com/v4/letter/f/77aa72/32.png) [@francois](https://openrndr.discourse.group/u/francois)\
**Post date:** [August 19, 2022, 3:18pm UTC](https://openrndr.discourse.group/t/transport-error-202-connect-failed-connection-refused/408/1 "2022-08-19T15:18:34Z")

</div>

Hello!

I installed openrndr yesterday but i had no luck so far and did not succeed to run the template program. 🫤

The debug message is the following :

```auto
Connected to the target VM, address: '127.0.0.1:51595', transport: 'socket'
Warning: Running on macOS without -XstartOnFirstThread JVM argument. Restarting JVM with -XstartOnFirstThread.
ERROR: transport error 202: connect failed: Connection refused
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c:734]
Disconnected from the target VM, address: '127.0.0.1:51595', transport: 'socket'
 
Process finished with exit code 0

```

I am on mac 12.3, M1 chip. The version of intellij Idea is 2022.2.1. Corretto version is 17.0.4.1.  
The localhost address is correct and seems to work. I also tried to run a basic kotlin program on the IDE and it worked.

Do you have any indications to troubleshoot this?

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![abe](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/abe/32/700_2.png) [@abe](https://openrndr.discourse.group/u/abe)\
**Post date:** [August 21, 2022, 10:29am UTC](https://openrndr.discourse.group/t/transport-error-202-connect-failed-connection-refused/408/2 "2022-08-21T10:29:06Z")

</div>

Hi @francois 🙂 Sorry I didn’t see your message earlier: somehow it was marked as spam.

Did you follow [Set up your first program - OPENRNDR GUIDE](https://guide.openrndr.org/setUpYourFirstProgram.html) ? Or what steps did you take?

Cheers

---

<div class="post-metadata">

**Author:** ![francois](https://avatars.discourse-cdn.com/v4/letter/f/77aa72/32.png) [@francois](https://openrndr.discourse.group/u/francois)\
**Post date:** [August 21, 2022, 10:57am UTC](https://openrndr.discourse.group/t/transport-error-202-connect-failed-connection-refused/408/3 "2022-08-21T10:57:51Z")

</div>

Hello @abe !  
Thanks for your reply. Yes, I followed this setup guide using and did a reinstall when I saw it didn’t work the first time.

In the meantime, I read the [should I use OPENRNDR?](https://guide.openrndr.org/shouldIUseOPENRNDR.html) section, where it is indicated :

> For macOS, we support versions 10.10 to 10.14. Older versions may work, but this is hard to verify in a structural fashion.

Is it still true?

---

<div class="post-metadata">

**Author:** ![abe](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/abe/32/700_2.png) [@abe](https://openrndr.discourse.group/u/abe)\
**Post date:** [August 21, 2022, 11:08am UTC](https://openrndr.discourse.group/t/transport-error-202-connect-failed-connection-refused/408/4 "2022-08-21T11:08:49Z")

</div>

I know several people are using M1 based computers. Is that what you would like to know? Or for older OSes?

I’ll ask in Slack see if anyone knows why this happens.

---

<div class="post-metadata">

**Author:** ![kazik](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/kazik/32/7_2.png) [@kazik](https://openrndr.discourse.group/u/kazik)\
**Post date:** [August 21, 2022, 11:13am UTC](https://openrndr.discourse.group/t/transport-error-202-connect-failed-connection-refused/408/5 "2022-08-21T11:13:27Z")

</div>

@francois Could you try to add `-XstartOnFirstThread` to VM parameters when starting your program. It is required when running OPENRNDR as a java process on Mac OS, so as a workaround, if it is not specified, OPENRNDR will restart the whole JVM spawning the new java process with this parameter added. But it brakes debugging, as the internal IntelliJ debugging parameters are not passed to underlying process. Is it possible that you started your program in debug instead of run mode? When `-XstartOnFirstThread` is added straight ahead, no JVM relaunching happens.

---

<div class="post-metadata">

**Author:** ![abe](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/abe/32/700_2.png) [@abe](https://openrndr.discourse.group/u/abe)\
**Post date:** [August 21, 2022, 11:29am UTC](https://openrndr.discourse.group/t/transport-error-202-connect-failed-connection-refused/408/6 "2022-08-21T11:29:50Z")

</div>

True… I only see the “connecting to 127.0.0.1” when debugging, not when running the program.

![image](https://global.discourse-cdn.com/free1/uploads/openrndr/original/1X/7b6752bed09884aace8bb96016e835d1f498295d.png)

---

<div class="post-metadata">

**Author:** ![francois](https://avatars.discourse-cdn.com/v4/letter/f/77aa72/32.png) [@francois](https://openrndr.discourse.group/u/francois)\
**Post date:** [August 21, 2022, 6:14pm UTC](https://openrndr.discourse.group/t/transport-error-202-connect-failed-connection-refused/408/7 "2022-08-21T18:14:24Z")

</div>

Hi @abe and @kazik

Thanks for your help and sorry for the misleading information of my first post : I should have posted the information I got from running the program.

Here is the information I get from the run console (after adding `-XstartOnFirstThread` to VM parameters, as @kazik suggested) :

```auto
Connected to the target VM, address: '127.0.0.1:50621', transport: 'socket'
[LWJGL] Platform/architecture mismatch detected for module: org.lwjgl
	JVM platform:
		macOS aarch64 17.0.4.1
		OpenJDK 64-Bit Server VM v17.0.4.1+9-LTS by Amazon.com Inc.
	Platform available on classpath:
		macos/x64
[LWJGL] Failed to load a library. Possible solutions:
	a) Add the directory that contains the shared library to -Djava.library.path or -Dorg.lwjgl.librarypath.
	b) Add the JAR that contains the shared library to the classpath.
[LWJGL] Enable debug mode with -Dorg.lwjgl.util.Debug=true for better diagnostics.
[LWJGL] Enable the SharedLibraryLoader debug mode with -Dorg.lwjgl.util.DebugLoader=true for better diagnostics.
 INFO [main] ↘ Set -Dorg.openrndr.exceptions=JVM for conventional exception-handling

│ TemplateProgramKt.main(TemplateProgram.kt:-1)
├─ TemplateProgramKt.main(TemplateProgram.kt:9)
│ org.openrndr.ApplicationBuilderKt.application(ApplicationBuilder.kt:82)
│ org.openrndr.ApplicationBuilder.<init>(ApplicationBuilder.kt:102)
│ org.openrndr.ApplicationBase.Companion.initialize(ApplicationBase.kt:22)
├─ java.lang.reflect.Constructor.newInstance(Constructor.java:480)
├─ java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
├─ jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
├─ jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
│ jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(NativeConstructorAccessorImpl.java:-2)
│
↑ null (InvocationTargetException) 
├─ org.lwjgl.system.Library.loadSystem(Library.java:164)
Disconnected from the target VM, address: '127.0.0.1:50621', transport: 'socket'

Process finished with exit code 1

```

---

<div class="post-metadata">

**Author:** ![kazik](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/kazik/32/7_2.png) [@kazik](https://openrndr.discourse.group/u/kazik)\
**Post date:** [August 21, 2022, 7:12pm UTC](https://openrndr.discourse.group/t/transport-error-202-connect-failed-connection-refused/408/8 "2022-08-21T19:12:44Z")

</div>

I am not using Mac OS on daily basis, but from your log it seems that you have a difference between JVM platform used by OPENRNDR libraries, and the one used by macOS by default. You can make sure to download IntelliJ version for M1:

> **[Download IntelliJ IDEA: The Capable & Ergonomic Java IDE by JetBrains](https://www.jetbrains.com/idea/download/#section=mac)**
>
> Download the latest version of IntelliJ IDEA for Windows, macOS or Linux.

There is a drop down, to pick “Apple Silicon”, because it’s “Intel” by default. I believe that Intel will still work with Roseta on M1, but it will be a suboptimal experience - for example I remember that GPU acceleration was super sluggish when scrolling text in editor. IntelliJ comes with JVM compiled for Apple Silicon, so you should be able to pick it as a JVM for running your program. I hope it would solve the issue. You can also download such a JVM separately. The latest JDK 18 for applie silicon is here (called “arm 64” to make it even more confusing):

> **[Download the Latest Java LTS Free](https://www.oracle.com/java/technologies/downloads/#jdk18-mac)**
>
> Subscribe to Java SE and get the most comprehensive Java support available, with 24/7 global access to the experts.

---

<div class="post-metadata">

**Author:** ![francois](https://avatars.discourse-cdn.com/v4/letter/f/77aa72/32.png) [@francois](https://openrndr.discourse.group/u/francois)\
**Post date:** [August 21, 2022, 8:27pm UTC](https://openrndr.discourse.group/t/transport-error-202-connect-failed-connection-refused/408/9 "2022-08-21T20:27:01Z")

</div>

I checked : I have the right version of IntelliJ IDEA installed on my machine.  
I also tried to run the template modifying the run configuration and indicating the last JRE you link. It unfortunately did not work.

Do I need to modify/add paths in the classpath to link to one of the JVM platform installed on my computer?

---

<div class="post-metadata">

**Author:** ![abe](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/abe/32/700_2.png) [@abe](https://openrndr.discourse.group/u/abe)\
**Post date:** [August 23, 2022, 7:33am UTC](https://openrndr.discourse.group/t/transport-error-202-connect-failed-connection-refused/408/10 "2022-08-23T07:33:57Z")

</div>

@antdegouv mentioned in Slack

> no sure it’s related at all but, i have an M1, and sense one of the updates of the RnDR template, that it refuses to use the arm64 version of lwjgl. i need to copy one of my older projects to work.

None of the core members have an M1 as main computer to test, but someone will very soon 🙂 Maybe I can try next Sunday.

---

<div class="post-metadata">

**Author:** ![francois](https://avatars.discourse-cdn.com/v4/letter/f/77aa72/32.png) [@francois](https://openrndr.discourse.group/u/francois)\
**Post date:** [August 23, 2022, 11:11am UTC](https://openrndr.discourse.group/t/transport-error-202-connect-failed-connection-refused/408/11 "2022-08-23T11:11:38Z")

</div>

@abe  
ok, I will wait for your feedback then! 🙂

---

<div class="post-metadata">

**Author:** ![abe](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/abe/32/700_2.png) [@abe](https://openrndr.discourse.group/u/abe)\
**Post date:** [August 31, 2022, 3:43pm UTC](https://openrndr.discourse.group/t/transport-error-202-connect-failed-connection-refused/408/12 "2022-08-31T15:43:05Z")

</div>

Hi there! Does changing this line

> <https://github.com/openrndr/openrndr-template/blob/master/build.gradle.kts#L222>

into

```auto
"arm-v8","aarch64" -> "macos-arm64"

```

help in your case? @antdegouv was also having issues on M1 and doing remote debugging @edwin figured out Gradle probably changed something that broke M1 detection.

Update: another thing that can help is adding `-XstartOnFirstThread` to the `VM Options` in the Run Configuration of your program. Latest openrndr from git has [a fix for this](https://github.com/openrndr/openrndr/commit/29beddc00d56409dd65b5d0f8c5f68dd28cfe42c).

---

<div class="post-metadata">

**Author:** ![francois](https://avatars.discourse-cdn.com/v4/letter/f/77aa72/32.png) [@francois](https://openrndr.discourse.group/u/francois)\
**Post date:** [September 20, 2022, 5:35pm UTC](https://openrndr.discourse.group/t/transport-error-202-connect-failed-connection-refused/408/13 "2022-09-20T17:35:13Z")

</div>

Hello @abe,  
Sorry for the late answer, I was abroad and away for my computer.

Adding `"aarch64"` makes things work! Thank you very much for the help!!  
It also worked without `-XstartOnFirstThread` as a `VM Options`. The main issue was in the build.gradle.kts file.
