I am trying to import import org.jfree.chart.fx.ChartViewer; in my program. After some research, I found I needed to build the build-fx.xml file to get this package included in my JFreeChart jar. So I used the line of code in a terminal setup to build ant ant -buildfile build-fx.xml but I got an error shown in the output below. Am I doing something wrong?
C:\Users\dan\Desktop\jfreechart-1.0.19\ant>ant -buildfile build-fx.xml
Buildfile: C:\Users\danie\Desktop\jfreechart-1.0.19\ant\build-fx.xml
initialise:
compile:
[mkdir] Created dir: C:\Users\danie\Desktop\jfreechart-1.0.19\build
[javac] Compiling 629 source files to C:\Users\danie\Desktop\jfreechart-1.0.19\build
[javac] C:\Users\danie\Desktop\jfreechart-1.0.19\source\org\jfree\chart\fx\ChartViewer.java:122: error: getUserAgentStylesheet() in ChartViewer cannot override getUserAgentStylesheet() in Region
[javac] protected String getUserAgentStylesheet() {
[javac] ^
[javac] attempting to assign weaker access privileges; was public
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 1 error
BUILD FAILED
C:\Users\dan\Desktop\jfreechart-1.0.19\ant\build-fx.xml:62: Compile failed; see the compiler error output for details.
Total time: 6 seconds
Sorry if this is obvious, it is the first time I have had to build a jar with ant.
This is a known error and it is fairly simple to fix. See here
To fix this problem change protected String getUserAgentStylesheet() { to public String getUserAgentStylesheet() { in the source files and then run the ant build again.
This should successfully build a jar called jfreechart-1.0.19-fx.jar to the lib folder
Related
I cannot build after updating flutter and andriodX. I keep gettng the error below with a lots of warning messages. I upgraged flutter. I also executed flutter doctor. It has not helped.
The app was working fine and in order to user Firebase authentication,I created SHA1. After that it stopped working. Please suggest. I have looked over all other similar questions but I can't seem to find a solution.
Note: C:\Users\username\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\firebase_core_web-0.1.1+2\android\src\main\java\io\flutter\plugins\firebase_core_web\FirebaseCoreWebPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
C:\Users\username\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\shared_preferences-0.5.7+3\android\src\main\java\io\flutter\plugins\sharedpreferences\SharedPreferencesPlugin.java:18: warning: [deprecation] Registrar in PluginRegistry has been deprecated
public static void registerWith(PluginRegistry.Registrar registrar) { ^
1 warning
C:\Users\username\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\webview_flutter-2.0.6\android\src\main\java\io\flutter\plugins\webviewflutter\InputAwareWebView.java:31: error: cannot find symbol
private ThreadedInputConnectionProxyAdapterView proxyAdapterView;
^
symbol: class ThreadedInputConnectionProxyAdapterView
location: class InputAwareWebView
C:\Users\username\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\webview_flutter-2.0.6\android\src\main\java\io\flutter\plugins\webviewflutter\InputAwareWebView.java:112: error: cannot find symbol
new ThreadedInputConnectionProxyAdapterView(
^
symbol: class ThreadedInputConnectionProxyAdapterView
location: class InputAwareWebView
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':webview_flutter:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
BUILD FAILED in 2m 22s
Exception: Gradle task assembleDebug failed with exit code 1
gradle.properties
android.useAndroidX=true
android.enableJetifier=true
I configed Jenkins to compile and build java project. But I got the below error
[javac] C:\Users\Administrator\.jenkins\workspace\AMRM\AMRM-rad-workspace\AMRM\src\com\bidv\amrm\struts2\jdbc\DeclareAppImpl.java:232: error: incompatible types
[javac] return DB.getConnection().queryForObject(sql, new Object[]{id}, new DTOMapper());
[javac] ^
[javac] required: ListAppDTO
[javac] found: Object
I found a solution to fix is adding the line: #SuppressWarnings("unchecked") before relate function in java code
But, are there any other solution ? Such as config in Jenkins ? I don't want to change my code, because My project still compiled success in Eclipse (but error in Jenkins)
I found the reason, it is because my jenkins still use a different java version.
So I pass the correct version (1.6) into build statement javac, then it is successful (java.home = C:\Program Files\Java\jdk1.6.0_23)
<javac fork="yes" executable="${java.home}\bin\javac" includeantruntime="false" encoding="utf-8" srcdir="${workspace}/${project.name}/src" destdir="${workspace}/${project.name}/WebContent/WEB-INF/classes" classpath="${was_cp}">
</javac>
But, I got another error:
Caused by: java.io.IOException: Cannot run program "C:\java1.6\bin\javac": CreateProcess error=206, The filename or extension is too long.
I am facing a strange problem when I try to compile a portlet plugin in 6.1.10.
The first version of the plugin didn't have any problems and was commited in the SVN. I made a branch of this plugin and some changes in the java files and since then I can't compile it from the prompt (in Liferay Studio 2.2.x it compiles correctly).
So, now I have in the same SDK the two versions of the same plugin, but the first version compiles without a problem, and the second has the following error:
[javac] 1. ERROR in /XXXX/liferay-plugins-sdk-6.1.10-ee-ga1/portlets/XXXX-portlet/docroot/WEB-INF/src/XXXX/ObjectFactory.java (at line 0)
[javac]
[javac] ^
[javac] Internal compiler error
[javac] java.lang.NullPointerException
[javac] at org.eclipse.jdt.internal.compiler.ast.SingleTypeReference.getTypeBinding(SingleTypeReference.java:44)
[javac] at org.eclipse.jdt.internal.compiler.ast.TypeReference.internalResolveType(TypeReference.java:130)
[javac] at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:197)
[javac] at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:193)
[javac] at org.eclipse.jdt.internal.compiler.ast.Annotation.resolveType(Annotation.java:231)
[javac] at org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveAnnotations(ASTNode.java:594)
[javac] at org.eclipse.jdt.internal.compiler.apt.dispatch.AnnotationDiscoveryVisitor.resolveAnnotations(AnnotationDiscoveryVisitor.java:143)
[javac] at org.eclipse.jdt.internal.compiler.apt.dispatch.AnnotationDiscoveryVisitor.visit(AnnotationDiscoveryVisitor.java:131)
[javac] at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDeclaration.java:1198)
[javac] at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.traverse(CompilationUnitDeclaration.java:687)
[javac] at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundEnvImpl.<init>(RoundEnvImpl.java:56)
[javac] at org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:148)
[javac] at org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:794)
[javac] at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:423)
[javac] at org.eclipse.jdt.internal.compiler.batch.Main.performCompilation(Main.java:3543)
[javac] at org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:1645)
[javac] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[javac] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[javac] at java.lang.reflect.Method.invoke(Method.java:597)
[javac] at org.eclipse.jdt.core.JDTCompilerAdapter.execute(JDTCompilerAdapter.java:79)
I checked the classpath of the two builds and they were the same apart of the name of the plugin folder. As they build in the same SDK, they are using the same java, the same compiler, portal etc. The java version is 1.6.0_65, but the problem is also reproduceable in different machines.
Also, the class that fails in the compilation is identical in the two projects.
Thanks in advance.
It seems that the liferay 6.1.10 SDK is using a very old ecj.jar (version 3.4.1). I deleted the ecj.jar from the ant lib directory (that was copied there by the liferay sdk), and replaced the ecj.jar of the sdk lib directory with the ecj 3.5.1. With the next 'ant war' the new ecj.jar is copied in the ant lib dir and with another run of the war task, the error was gone.
See also the bug in eclipse bugzilla in the above comments.
I have done my Automation in java using Junit and push that code to bitbucket and integrated it with jenkins. But when i am starting build after creating job it start failling and throwing some error. i am not able get that why it is not taking class path and how i can set class path to avoid this issue
Here is error coming on console
[javac] C:\Program Files\Jenkins\workspace\ABC-first-job\tst\com\cb\abc\ABCTest.java:110: error: cannot find symbol
[javac] Assert.assertTrue(response.contains(ABCConstant.DATA_MESSAGE));
[javac] ^
[javac] symbol: variable Assert
[javac] location: class ABCTest
[javac] 47 errors
BUILD FAILED
C:\Program Files\Jenkins\workspace\ABC-first-job\build.xml:48: Compile failed; see the compiler error output for details.
Total time: 2 seconds
Build step 'Invoke Ant' marked build as failure
Finished: FAILURE
Check if there was any recent jdk version updates for jdk used to build the code. If you have a slave node also check the jdk version on the same.
I am using ant to compile android project. But when compile error happens, it always only prints the file name instead of path + file name.
Something like this:
compile:
[javac] /home/ccheng/program/predecate_android_sdk/tools/ant/main_rules.xml:384: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 2 source files to /home/ccheng/workspace_helio/android_test/bin/classes
[javac] MainActivity.java:25: not a statement
[javac] asdfasdf
[javac] ^
[javac] MainActivity.java:25: ';' expected
[javac] asdfasdf
[javac] ^
[javac] 2 errors
So because of it, however hard i try to configure my vim, the file name always can't be matched.I doubt there must be a method to make ant print the full path or configure vim to match the file name.
thanks.
I have solved this problem. It's not about the ant, it is caused by javac. My previous jdk is openjdk-1.6-jdk, it won't print path. As soon as i change to gcj-4.6, then path will be printed. It seems tha openjdk-1.7 also fixes this problem.