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

package com.dustinredmond does not exist #6

Closed
MalteKiefer opened this issue Feb 5, 2021 · 2 comments
Closed

package com.dustinredmond does not exist #6

MalteKiefer opened this issue Feb 5, 2021 · 2 comments

Comments

@MalteKiefer
Copy link

Hello,

try to use your package.
My gradle looks like this:

// Mustercode für build.gradle
plugins {
    id 'java'
    // add
    id 'application'
    id 'org.openjfx.javafxplugin' version '0.0.8'
}

// add
mainClassName = 'org.stingle.photos.MainApp'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    compile group: 'com.dustinredmond.fxtrayicon', name: 'FXTrayIcon', version: '2.6.0'
    testCompile group: 'junit', name: 'junit', version: '4.12'
}

// add
javafx {
    version = "11"
    modules = [ 'javafx.controls', 'javafx.fxml' ]
}

My class looks like this:

package org.stingle.photos;

import javafx.application.*;
import javafx.fxml.FXMLLoader;
import javafx.scene.*;
import javafx.stage.*;
import com.dustinredmond.fxtrayicon;

import java.io.IOException;

public class MainApp extends Application {
    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) {
        try {
            Parent root = FXMLLoader.load(getClass().getResource("/login.fxml"));
            Scene scene = new Scene(root, 350, 500);
            primaryStage.setTitle("Stingle Photos");
            primaryStage.setScene(scene);
            primaryStage.setResizable(false);
            primaryStage.show();

            FXTrayIcon icon = new FXTrayIcon(primaryStage, getClass().getResource("/images/logo.png"));
            icon.show();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

I get these errors when I run gradle

~/Entwicklung/org.stingle.photos via ☕ v15.0.2 ❯ ./gradlew run

> Task :compileJava FAILED
/Users/maltekiefer/Entwicklung/org.stingle.photos/src/main/java/org/stingle/photos/MainApp.java:7: error: package com.dustinredmond does not exist
import com.dustinredmond.fxtrayicon;
                        ^
/Users/maltekiefer/Entwicklung/org.stingle.photos/src/main/java/org/stingle/photos/MainApp.java:26: error: cannot find symbol
            FXTrayIcon icon = new FXTrayIcon(primaryStage, getClass().getResource("/images/logo.png"));
            ^
  symbol:   class FXTrayIcon
  location: class MainApp
/Users/maltekiefer/Entwicklung/org.stingle.photos/src/main/java/org/stingle/photos/MainApp.java:26: error: cannot find symbol
            FXTrayIcon icon = new FXTrayIcon(primaryStage, getClass().getResource("/images/logo.png"));
                                  ^
  symbol:   class FXTrayIcon
  location: class MainApp
3 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 753ms
1 actionable task: 1 executed
@dustinkredmond
Copy link
Owner

@MalteKiefer you should import FXTrayIcon as below:

import com.dustinredmond.fxtrayicon.FXTrayIcon;

Also, what JDK version are you using to compile this?

@MalteKiefer
Copy link
Author

That was the error. thanks

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

No branches or pull requests

2 participants