Java wo liegt der Fehler?

Hallo gutefrage-Community,

ich habe unten gezeigten Quellcode verfasst und dabei keinerlei Fehlermeldungen oder Exceptions erhalten. Am Ende kommt aber irgendwie trotzdem nicht heraus, was herauskommen soll.

Was ich erwarte:

Aus einem JTextField erhält man einen String "input" wie z.B. 2x+5=10x-3. Dieser wird zuerst beim "=" gesplittet. Daraus erhält man ein Array mit zwei Strings: 2x+5 und 10x-3. Diese beiden Arrays sollen nun an allen "+" und "-" gesplittet werden. Deshalb wird eine Schleife zweimal durchlaufen und dabei im ersten Durchlauf der erste und im zweiten Durchlauf der zweite String verarbeitet. Danach wird bei jeder Zahl mit "x" das "x" entfernt und ein boolean auf true gesetzt. Was am Ende herauskommen soll:

Drei Arrays (int num[], boolean isFactorOfVar[] und boolean isOnRightSide[]), die immer dem gleichen Index entsprechen, also: num[0] gehört zu isFactorOfVar[0] und zu isOnRightSide[0], num[1] gehört zu isFactorOfVar[1] und zu isOnRightSide[1] usw. Dabei soll num[] der Zahl entsprechen, isFactorOfVar, ob ein x am Ende entfernt wurde und isOnRightSide[], ob sich diese Zahl auf der rechten Seite des "=" befindet. Hier ist das am Anfangsbeispiel 2x+5=10x-3 gezeigt:

  • num[0] = 2; isFactorOfVar[0] = true; isOnRightSide[0] = true
  • num[1] = 5; isFactorOfVar[1] = false; isOnRightSide[1] = true
  • num[2] = 10; isFactorOfVar[2] = true; isOnRightSide[2] = false
  • num[3] = 3; isFactorOfVar[3] = false; isOnRightSide[3] = false

Was herauskommt:

  • num[0] = 2; isFactorOfVar[0] = true; isOnRightSide[0] = nicht angezeigt
  • Fehlermeldung

Mein Code:

Fehlermeldung:

Bild zum Beitrag
Computer, Technik, programmieren, Java, Informatik, Programmiersprache, Algorithmus
Node JS / Npm Fehlermeldung?

Ich wollte Robot JS installieren mit Windows (Unter Linux klappt alles super )

jedoch tritt diese Fehlermeldung auf und ich habe schon viel versucht.

Nichts hilft. https://pastebin.com/1VfKGnXx

Habe auch beim installieren von NodeJS darauf geachtet das es diese Python/C++ Pakete oder so mit installiert.

PS C:\Users\maxmustermann\Desktop\robotjs> npm install robotjs

Es installiert kurz Robot Js und dann löscht es sich wieder und dann erscheint das

Part 1:

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code 1
npm ERR! path C:\Users\maxmustermann\Desktop\robotjs\node_modules\robotjs
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c prebuild-install || node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.0.0
npm ERR! gyp info using node@18.3.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.5 found at "C:\Users\maxmustermann\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS checking VS2022 (17.2.32602.215) found at:
npm ERR! gyp ERR! find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
npm ERR! gyp ERR! find VS - found "Visual Studio C++ core features"
npm ERR! gyp ERR! find VS - missing any VC++ toolset
npm ERR! gyp ERR! find VS checking VS2019 (16.11.32602.291) found at:
npm ERR! gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
npm ERR! gyp ERR! find VS - found "Visual Studio C++ core features"
npm ERR! gyp ERR! find VS - missing any VC++ toolset
npm ERR! gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS

Die ganze Fehlermeldung passt hier nicht rein.

PC, Computer, Software, Technik, programmieren, JavaScript, Informatik, npm

Meistgelesene Beiträge zum Thema Informatik