javac

SublimeLinter-javac not recognising other packages

纵然是瞬间 提交于 2019-12-24 07:07:06
问题 I have a Spring Product That I'm trying the use sublimLinter-javac with, and there are a few packages scattered around the project. The problem is that sublimeLinter-javac is not recognising these packages or the classes within. So I end up with 200+ errors per file making the listing pointless. How do I tell sublimeLinter where to look for these classes? 回答1: I am guessing your classpath is not pointing to the right place. You can find here an explanation on how to set project settings.

Cannot Compile WordCount.java

不羁的心 提交于 2019-12-24 01:27:12
问题 mark@maestro1:/usr/lib/hadoop/wordcount_classes$ javac -classpath /usr/lib/hadoop/hadoop-common-2.0.0-cdh4.0.1.jar:/usr/lib/hadoop/client/hadoop-mapreduce-client-core-2.0.0-cdh4.0.1.jar -d /usr/lib/hadoop/wordcount_classes /usr/lib/hadoop/wordcount_classes/WordCount.java /usr/lib/hadoop/hadoop-common-2.0.0-cdh4.0.1.jar(org/apache/hadoop/fs/Path.class): warning: Cannot find annotation method 'value()' in type 'LimitedPrivate': class file for org.apache.hadoop.classification.InterfaceAudience

matlab deploytool to java package javac error

試著忘記壹切 提交于 2019-12-24 00:58:36
问题 I'm trying to wrap a program of mine to work with java. I tried a simple "hello world" first, -hello world.m- disp('hello world'); I used deploytool and selected java package. when it reached this line: Executing command: "javac -verbose -classpath "C:\Program Files\MATLAB\R2009b\toolbox\javabuilder\jar\javabuilder.jar" -d "C:\Users\shachar\Documents\MATLAB\deployTutorial\deployTutorial2\src\classes" "C:\Users\shachar\Documents\MATLAB\deployTutorial\deployTutorial2\src\deployTutorial2

Do annotations in Java result in compile-time transitive dependencies?

非 Y 不嫁゛ 提交于 2019-12-23 20:22:03
问题 A simple example where Ent.java uses annotations and is compiled with the necessary jar dependency after which Includer.java is compiled which in turn imports Ent.java . Ent.java: import javax.persistence.Entity; import javax.persistence.Table; @Entity @Table(name="securities") public class Ent {} Includer.java: public class Includer { public void f() { Ent s = new Ent(); } } Compiling this with... javac -cp C:/apache-tomcat-7.0.59/lib/javax.persistence_2.1.0.v201304241213.jar Ent.java javac

How to make Java compiler generate line numbers in compiled code

*爱你&永不变心* 提交于 2019-12-23 18:19:55
问题 I have a hello world program called A.class . It was compiled using command javac A.java . All it does is print "hello world" . Next, I compiled using javac -g A.java . I am expecting to see line numbers, but can't see. Any idea what happened? I do see very minor differences in some kind of special characters between .class file of javac compiled, and javac -g compiled. But I can't see any line numbers. My curiosity for this is because I want to find what kind of impact line numbers may have

How to Run Annotation Processor without compiling sources using javac (Java 8 can't use Apt)

拟墨画扇 提交于 2019-12-23 11:52:35
问题 How can i Run Annotation Processor without compiling sources using javac (Java 8 can't use Apt)? Is there any parameter for javac that could run only annotation processing without compiling all files? What i want to do by javac: Just find annotated elements and process them using defined annotation processor using -processor flag do not compile any source that doesn't have any annotation Because i want do this on Java 8 it's impossible to use Apt for this task? Or maybe it is? 回答1: The apt

Eclipse ECJ accepts this code, javac doesn't - who is right?

 ̄綄美尐妖づ 提交于 2019-12-23 10:09:36
问题 Consider the following returnsNull function and a call to it with a generic type: public static <T> List<T> returnNull(Class<? extends T> clazz) { return null; } public static void main( String[] args ) { List<AtomicReference<?>> l = returnNull(AtomicReference.class); } The Eclipse compiler, when set to Java 8, accepts it, but javac in Java 8 rejects it with: incompatible types: cannot infer type-variable(s) T (argument mismatch; java.lang.Class<java.util.concurrent.atomic.AtomicReference>

Why are equal java strings taking the same address? [duplicate]

和自甴很熟 提交于 2019-12-23 08:56:40
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: String object creation using new and its comparison with intern method I was playing around with Strings to understand them more and I noticed something that I can't explain : String str1 = "whatever"; String str2 = str1; String str3 = "whatever"; System.out.println(str1==str2); //prints true...that's normal, they point to the same object System.out.println(str1==str3); //gives true..how's that possible ? How is

Why does the package-info.java file affect annotation-processing?

那年仲夏 提交于 2019-12-23 05:16:36
问题 Adding a package-info.java file to the project, causes annotation-processors to create different output. I don't understand why this happens. I think adding the package-info.java file should not affect my build at all, because it does not contain any fancy stuff (like Annotations, etc.). It only contains the simplest package declaration: package com.example; I've managed to create a minimal project to reproduce the issue with javac only. The project has too much code to post here on

Compile and Run java program in linux with path to the .java file and path to external jars

痞子三分冷 提交于 2019-12-23 03:37:18
问题 Yesterday I solved a problem with an answer here on stackoverflow. But I ended up with another problem, I will try to be clear: I have a project folder in the /home/demo/Desktop/xlsToCsv/ directory where inside of it is the java file "xlsToCsv.java" and another directory with the external jars that I need in /home/demo/Desktop/xlsToCsv/jars . Now I need to compile and run my program. Yesterday I ran a command that assumed that I was already inside of /home/demo/Desktop/xlsToCsv/ , and the