javac

javac error message does not display entire filepath

喜欢而已 提交于 2019-12-12 08:53:21
问题 When using javac (or the ant task ), the error message does not include the entire filepath, it only includes the file name. For example, $ javac src/path/to/Filename.java Filename.java:1: package foo.bar does not exist import foo.bar.Baz; ^ What I would like is, $ javac src/path/to/Filename.java src/path/to/Filename.java:1: package foo.bar does not exist import foo.bar.Baz; ^ My problem is that vim quickfix does not work if it's not given the entire filepath, not just the filename. With just

unable to use an intersection type when notional class requires access modification

半世苍凉 提交于 2019-12-12 08:49:31
问题 Interfaces: interface PublicCloneable { Object clone(); } interface HasPosition { // doesn't matter } Attempt to use intersection type: @SuppressWarnings("unchecked") <E extends PublicCloneable & HasPosition> E cloneAndIncrementPosition(E elem) { final E clone = (E)elem.clone(); // rest omitted } Attempt to compile with javac 1.8.0_60 : $ javac xx.java xx.java:13: error: clone() in Object cannot implement clone() in PublicCloneable <E extends PublicCloneable & HasPosition> E

What does $$ in javac generated name mean?

☆樱花仙子☆ 提交于 2019-12-12 08:48:11
问题 When shifting through java call graph generated by libraries like DependencyFinder and java-callgraph, I found out that java compiler generate names for anonymous functions, inner classes, etc. I've found out the meaning of a couple of them (please correct if I'm wrong): org.example.Bar$Foo refers to Foo , which is an inner class of org.example.Bar . org.example.Bar$1 refers to an anonymous class declared inside one of the methods of org.example.Bar . org.example.Bar.lambda$spam$1() refers to

Java: specific enums and generic Enum<?> parameters

三世轮回 提交于 2019-12-12 08:06:06
问题 I want to pass any enum value to method in utility class and get another enum value of same enum type. Something like this: public class XMLUtils { public static Enum<?> getEnumAttribute(Element element, String name, Enum<?> defaultValue) { if (element.hasAttribute(name)) { String valueName = element.getAttribute(name); // search for value for (Enum<?> value: defaultValue.getClass().getEnumConstants()) if (value.toString().equalsIgnoreCase(valueName)) return value; } // not found, return

“package javax.inject does not exist” error while compiling with javac in commandline

女生的网名这么多〃 提交于 2019-12-12 07:49:35
问题 I'm making my first steps toward learning JSF. I found this interesting book called "Core JavaServer Faces Third Edition". Trying to compile the first example, you can download the source code from: http://horstmann.com/corejsf/. When I type the following on the command-line javac UserBean.java I get errors: package javax.inject does not exist package javax.enterprise.context doe not exist I have downloaded Java EE, Ant and GlassFish. Here is a snap of my command-line: C:\JSF-Tutorial

Java compiler is using old version of source code

◇◆丶佛笑我妖孽 提交于 2019-12-12 05:13:25
问题 I am experiencing a very annoying problem to me, imagine I compile the file FooBar.java: $ javac FooBar.java It compiles sucefully and then I run it as usual: $ java FooBar < in.txt I get the output as expected, the deal is, if I change the source code (FooBar.java) to print something else and compile it again I get the same output as the first time! This is really making me mad... is there any cache for the javac? Even if I delete FooBar.class and recompile I get the output from the early

Manually compile and run multiple packages using javac/java

狂风中的少年 提交于 2019-12-12 05:12:33
问题 Let's say I have the following folder structure: \src\com\proj\pp1\stuff where com.proj.pp1 and com.proj.pp1.stuff are the two packages I have: -src -com -proj -pp1 tester.java -stuff some other .java's Being the main function in tester.java, and using the classes declared in /stuff. In tester.java I declare the imports that way: package com.proj.pp1; import com.proj.pp1.*; And in all the files declared under stuff: package com.proj.pp1.stuff; without any imports. I'm able to get the .class's

Classpath option works for javac but not for java (Windows)

匆匆过客 提交于 2019-12-12 03:28:52
问题 Hi and thanks for reading, after usually working with C# I tried writing some java code yesterday to process an XML file. I didn't use an IDE or anything, just Notepad++, SDK and a lot of Google :) I needed to include some jar files for which I found out, that one needs to set the classpath as a command line parameter to find the jar file. That worked well: javac -cp "./metadata-extractor-2.9.1.jar;./xmpcore-5.1.2.jar" DescribeIt.java Although using the same syntax when running it with java

build ant error Compile failed; at line fork=“${need.javac.fork}”

China☆狼群 提交于 2019-12-12 02:28:24
问题 When i try to build my project i got error line custom_rules.xml:63 is: line 78 is : fork="${need.javac.fork}"> Parameters of build are -Dsdk.dir=C:\Users\bou\sdk -Ddeploy.env=preprod_artiste1 -verbose after build i want replace folder res by another res in res-xxxxxx\res-artiste1\res BUILD FAILED C:\Users\bou\native-android\custom_rules.xml:63: The following error occurred while executing this line: C:\Users\bou\native-android\custom_rules.xml:78: Compile failed; see the compiler error

compile 'com.firebaseui:firebase-ui:0.4.3 how to fix error. i get every time error with any firebase ui dependencies

断了今生、忘了曾经 提交于 2019-12-12 01:49:55
问题 Error:Execution failed for task ':app:compileDebugJavaWithJavac'. Compilation failed; see the compiler error output for details how to fix this error please ans me my build.gradle apply plugin: 'com.android application' android { compileSdkVersion 25 buildToolsVersion '25.0.2' defaultConfig { applicationId "com.example.mayur.mahadev" minSdkVersion 22 targetSdkVersion 25 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes {