Tic Tac Toe in Java funktioniert nicht

AT-AT

Cadet 4th Year
Registriert
Sep. 2020
Beiträge
84
Hi, ich will programmieren lernen und habe dazu dieses Tutorial angeschaut. Ich habe alles mitgeschrieben und genau so gemacht wie er im Video. Als er das Programm zwischendrin gestartet hat sich bei ihm das Fenster geöffnet. Wenn ich es ausführe kommt aber folgender Code in der Console:

PHP:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no awt in system library path: C:\Users\Benutzername\AppData\Local\Temp\eoi2C1F.tmp\plugins\org.eclipse.justj.openjdk.hotspot.jre.minimal.stripped.win32.x86_64_15.0.1.v20201027-0507\jre\bin
    at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.base/java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.base/java.lang.System.loadLibrary(Unknown Source)
    at java.desktop/java.awt.Toolkit$2.run(Unknown Source)
    at java.desktop/java.awt.Toolkit$2.run(Unknown Source)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at java.desktop/java.awt.Toolkit.loadLibraries(Unknown Source)
    at java.desktop/java.awt.Toolkit.<clinit>(Unknown Source)
    at java.desktop/java.awt.Component.<clinit>(Unknown Source)
    at pack1.Gui.<init>(Gui.java:12)
    at pack1.Main.main(Main.java:7)

Weiß jemand was ich eventuell falsch gemacht habe? Danke im Voraus
 
java --version
java 15.0.1 2020-10-20
Java(TM) SE Runtime Environment (build 15.0.1+9-18)
Java HotSpot(TM) 64-Bit Server VM (build 15.0.1+9-18, mixed mode, s

Das kam raus bei java -version
 
Habe gerade mal die Java Version die ich hatte deinstalliert und die von dem Link weiter oben für Windows 64 bit runtergeladen, geht aber immer noch nicht

Hier die Ergebnisse von javac

PHP:
javac
Usage: javac <options> <source files>
where possible options include:
  @<filename>                  Read options and filenames from file
  -Akey[=value]                Options to pass to annotation processors
  --add-modules <module>(,<module>)*
        Root modules to resolve in addition to the initial modules, or all modules
        on the module path if <module> is ALL-MODULE-PATH.
  --boot-class-path <path>, -bootclasspath <path>
        Override location of bootstrap class files
  --class-path <path>, -classpath <path>, -cp <path>
        Specify where to find user class files and annotation processors
  -d <directory>               Specify where to place generated class files
  -deprecation
        Output source locations where deprecated APIs are used
  --enable-preview
        Enable preview language features. To be used in conjunction with either -source or --release.
  -encoding <encoding>         Specify character encoding used by source files
  -endorseddirs <dirs>         Override location of endorsed standards path
  -extdirs <dirs>              Override location of installed extensions
  -g                           Generate all debugging info
  -g:{lines,vars,source}       Generate only some debugging info
  -g:none                      Generate no debugging info
  -h <directory>
        Specify where to place generated native header files
  --help, -help, -?            Print this help message
  --help-extra, -X             Print help on extra options
  -implicit:{none,class}
        Specify whether or not to generate class files for implicitly referenced files
  -J<flag>                     Pass <flag> directly to the runtime system
  --limit-modules <module>(,<module>)*
        Limit the universe of observable modules
  --module <module>(,<module>)*, -m <module>(,<module>)*
        Compile only the specified module(s), check timestamps
  --module-path <path>, -p <path>
        Specify where to find application modules
  --module-source-path <module-source-path>
        Specify where to find input source files for multiple modules
  --module-version <version>
        Specify version of modules that are being compiled
  -nowarn                      Generate no warnings
  -parameters
        Generate metadata for reflection on method parameters
  -proc:{none,only}
        Control whether annotation processing and/or compilation is done.
  -processor <class1>[,<class2>,<class3>...]
        Names of the annotation processors to run; bypasses default discovery process
  --processor-module-path <path>
        Specify a module path where to find annotation processors
  --processor-path <path>, -processorpath <path>
        Specify where to find annotation processors
  -profile <profile>
        Check that API used is available in the specified profile
  --release <release>
        Compile for the specified Java SE release. Supported releases: 7, 8, 9, 10, 11, 12, 13, 14, 15
  -s <directory>               Specify where to place generated source files
  --source <release>, -source <release>
        Provide source compatibility with the specified Java SE release. Supported releases: 7, 8, 9, 10, 11, 12, 13, 14, 15
  --source-path <path>, -sourcepath <path>
        Specify where to find input source files
  --system <jdk>|none          Override location of system modules
  --target <release>, -target <release>
        Generate class files suitable for the specified Java SE release. Supported releases: 7, 8, 9, 10, 11, 12, 13, 14, 15
  --upgrade-module-path <path>
        Override location of upgradeable modules
  -verbose                     Output messages about what the compiler is doing
  --version, -version          Version information
  -Werror                      Terminate compilation if warnings occur
 
Das komische ist, eigentlich sollte die Java_Home Variable seit den neuesten Java Versionen automatisch gesetzt werden. Hast du evtl nicht alles bei der installation angekreuzt?:D ich hab vor 2Jahren oder so die Variable setzen müssen, seit 2 Jahren immer nur jdk installieren und automatisch wurde diese bei mir während der installation gesetzt. seltsam
 

Ähnliche Themen

Zurück
Oben