Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

raiden-e/sem3-pk-praktikum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PK-Praktikum

Semester 3 Programmierkurs Praktikum

Authors

  • Herny Küfner
  • Raiden Erdmann

Eclipse quick start

Adding external classes

To add external classes such as xmpcore.jar or metadata-extractor-2.16.0.jar, you have to copy the .jar files into lib and create .classpath manually:

<!-- .classpath -->
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
        <attributes>
            <attribute name="module" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="lib" path="lib/metadata-extractor-2.16.0.jar">
        <attributes>
            <attribute name="module" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="lib" path="lib/xmpcore-6.1.11.jar">
        <attributes>
            <attribute name="module" value="true"/>
        </attributes>
    </classpathentry>
</classpath>

You may also have to add JavaFX as a User Library. (via Aufgaben/Praktikum10)

JAVA Setup

VSCode is difficult to set up, especially when trying to include libraries

Download JDK 15.0.1

Set JAVA_HOME envoirentment variable:

setx -m JAVA_HOME "D:\java\bin" # Where D:\java... is the path to *your* java

Install VS Code and Java Extension Pack

Sometimes you need to Add folder to Java Source Path, by right-clicking inside to root folder in VSCode

Uninstall Maven and Java projectmgr extension

clean workspace

Folder Structure

The workspace contains two folders by default, where:

  • src: the folder to maintain sources
  • lib: the folder to maintain dependencies

Meanwhile, the compiled output files will be generated in the bin folder by default.

If you want to customize the folder structure, open .vscode/settings.json and update the related settings there.

Dependency Management

The JAVA PROJECTS view allows you to manage your dependencies. More details can be found here.

You may also want to create .vscode/settings.json:

// settings.json
// Does not work with JavaFX for whatever reason
{
    "java.project.sourcePaths": [
        "src",
        "lib",
        ""
    ],
    "java.project.referencedLibraries": [
        "lib/**/*.jar"
    ],
}