Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] remove maple_loader.jar usage #67

Closed
dadul96 opened this issue Aug 30, 2020 · 4 comments · Fixed by #89
Closed

[Windows] remove maple_loader.jar usage #67

dadul96 opened this issue Aug 30, 2020 · 4 comments · Fixed by #89

Comments

@dadul96
Copy link

dadul96 commented Aug 30, 2020

This problem occurs when a second (different) Java version is installed on a windows PC (besides the one provided with the Arduino IDE). Instead of using the provided Java version of the Arduino IDE the maple_upload.bat-file uses the Java version found in the environment path (oftentimes this is a different one).

This results in the following error message:

maple_loader v0.1
Resetting to bootloader via DTR pulse
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000007110b5db, pid=12684, tid=0x0000000000003214
#
# JRE version: Java(TM) SE Runtime Environment (8.0_261-b12) (build 1.8.0_261-b12)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.261-b12 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [jSSC-2.8_x86_64.dll+0xb5db]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\Daniel\AppData\Local\Arduino15\packages\STM32\tools\STM32Tools\1.4.0\tools\win\hs_err_pid12684.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

To solve this problem the following line should be added to the maple_upload.bat:
if exist "C:\Program Files (x86)\Arduino\java\bin" set PATH=C:\Program Files (x86)\Arduino\java\bin;%PATH%

This line temporarily changes the PATH during the execution of this batch file and ensures that the correct Java version is used.

This issue also has been discussed here.

@fpistm
Copy link
Member

fpistm commented Apr 15, 2021

Hi @dadul96
I never met this issue but it seems valid.
Anyway the proposed solution in #67 seems not complete (See rogerclarkmelbourne/Arduino_STM32#846) nor compatible with other IDE (Ex: PIO or Eclispe +Sloeber) as they are using the Arduino Java.
My guess is that .jar should be replaced to avoid any further issue. This would be more efficient than trying to give correct (and older) java version. What will happen if next Arduino IDE version change the Java version? It will probably failed.

@fpistm fpistm added the Bug label Apr 15, 2021
@fpistm fpistm added this to To do in STM32duino libraries via automation Apr 15, 2021
@dadul96
Copy link
Author

dadul96 commented Apr 15, 2021

Hello @fpistm
I see what you mean - my fix gives some nasty side effects to Linux and macOS users. Of course, the ideal solution would be to replace the .jar, but I don't think that I could lift such a huge architectural change. As a temporary solution, my old (unimproved) version of the PR (if exist "C:\Program Files (x86)\Arduino\java\bin" set PATH=C:\Program Files (x86)\Arduino\java\bin;%PATH%) could be used. This at least allows Arduino IDE users (who installed it in the default directory) to solve this issue. All other operating systems and IDE's would not be affected by this fix.

@fpistm
Copy link
Member

fpistm commented Apr 15, 2021

Right, anyway several user does not install Arduino to the default location.
I will replace the jar by a smaller binary doing the same than Linux and MacOS.
Probably using a multi OS serial library like https://github.com/wjwwood/serial

@fpistm fpistm changed the title Java Runtime PATH problem under Windows (EXCEPTION_ACCESS_VIOLATION) [Windows] remove maple_loader.jar usage Feb 9, 2023
fpistm added a commit to fpistm/Arduino_Tools that referenced this issue Feb 14, 2023
to remove java dependecy on Windows

fixes stm32duino#67

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
fpistm added a commit to fpistm/Arduino_Tools that referenced this issue Feb 14, 2023
to remove java dependecy on Windows

fixes stm32duino#67

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
fpistm added a commit to fpistm/Arduino_Tools that referenced this issue Feb 15, 2023
to remove java dependecy on Windows

fixes stm32duino#67

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
STM32duino libraries automation moved this from To do to Done Feb 20, 2023
@ChetW
Copy link

ChetW commented Mar 18, 2023

Thank you for this thread! Fixed my issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

3 participants