Attempting to assign weaker access privileges error in ChartViewer class

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
mcgeochd
Posts: 6
Joined: Thu Jul 19, 2018 10:38 pm
antibot: No, of course not.

Attempting to assign weaker access privileges error in ChartViewer class

Post by mcgeochd » Fri Jul 20, 2018 3:49 am

I've just installed JFreeChart 1.0.19 and JCommon 1.0.23 in my Intellij IDE as project libraries, set up the compile and runtime dependencies, designated the source folders, etc... but now I have one problem left showing up in my console log when I attempt to compile my project:

getUserAgentStylesheet()' in 'org.jfree.chart.fx.ChartViewer' clashes with 'getUserAgentStylesheet()' in 'javafx.scene.layout.Region'; attempting to assign weaker access privileges ('protected'); was 'public

I also have nearly 100 deprecation warnings for features in JFreeChart which seems odd too as this was latest version I could find to download...

I'm running with java 1.80_121 and my version of Intellij is 2017.3.5 though I will update to 2018.1.6 soon, any help is appreciated

EDIT: updated Intellij to 2018.1.6

John Matthews
Posts: 513
Joined: Wed Sep 12, 2007 3:18 pm

Re: Attempting to assign weaker access privileges error in ChartViewer class

Post by John Matthews » Sat Jul 21, 2018 12:59 am

Here's more on the style sheet issue. JFreeChart version 1.5 is current.

mcgeochd
Posts: 6
Joined: Thu Jul 19, 2018 10:38 pm
antibot: No, of course not.

Re: Attempting to assign weaker access privileges error in ChartViewer class

Post by mcgeochd » Sat Jul 21, 2018 1:36 am

Hi,

Thanks for getting back to me so quickly, I've commuted to the newest JFreeChart version from the GitHub link you posted, and now I have a problem where JFreeChart classes can't pickup the junit jar from jcommon 1.0.23 even when I add it as a compile time dependency.

Error:(43, 24) java: package org.junit does not exist
Error:(43, 1) java: static import only from classes and interfaces
Error:(46, 17) java: package org.junit does not exist

Cheers for the help

John Matthews
Posts: 513
Joined: Wed Sep 12, 2007 3:18 pm

Re: Attempting to assign weaker access privileges error in ChartViewer class

Post by John Matthews » Sat Jul 21, 2018 5:28 pm

NB: "When migrating from JFreeChart 1.0.x to JFreeChart 1.5.0…all the classes from JCommon that are used by JFreeChart have [been] integrated within the JFreeChart jar file within a different package than before (you will need to change your imports)."

mcgeochd
Posts: 6
Joined: Thu Jul 19, 2018 10:38 pm
antibot: No, of course not.

Re: Attempting to assign weaker access privileges error in ChartViewer class

Post by mcgeochd » Sat Jul 21, 2018 6:51 pm

Hi again,

I assume I must have done something wrong when I installed this as I have another error now do with the package names not matching the file structure, I checked the names that I have against the names in the code hosted on GitHub and they're identical so I'm not sure exactly whats going on as it seems like it works for other people without changing the package names, the problem I'm having is:

Package name 'org.jfree.data.xy' does not correspond to the file path 'main.java.org.jfree.data.xy'

This error is repeated respectively for all classes, interfaces, etc... in all packages under the main/java.org.free/ file path.

I also had a problem where all of the classes in src/test were throwing similar errors but as these are test classes, I simply excluded them
from the compilation. I apologise if this problem is covered elsewhere but so far I have been unable to find any Intellij IDEA specific
support related to installation and setup issues for JFreeChart on the forums.

Cheers again for the help

EDIT: I removed JCommon and redid all the imports so the previous problem appears to have been solved

EDIT: Moved src folder designation in Project Settings down to java.org.jfree and this appears to have fixed the package file path problem, now though,
some of the classes within java.org.jfree/data/xy appear to not be able to locate classes outside of the 'xy' package but within 'data', none of the
classes within java.org.jfree/chart appear to share this problem though

EDIT: manually imported the classes, problem fixed

Locked