Questions tagged [javac]

javac is the primary Java compiler, included in the Java Development Kit (JDK) from Sun Microsystems (now Oracle), and also in versions from other vendors.

javac is the primary Java compiler, included in the Java Development Kit (JDK) from Sun Microsystems (now Oracle), and also in versions from other vendors.

The compiler accepts source code conforming to the Java language specification (JLS) and produces bytecode conforming to the Java Virtual Machine Specification (JVMS). javac is itself written in Java. The compiler can also be invoked programmatically.

2467 questions
1
vote
4 answers

How can I tell the difference between some identifier and a variable declaration?

I'm making a simple parser for some Java-like language (just for learning purposes). I'm having trouble determining whether a statement is a variable declaration. This may be a problem with my lexer (which is really sloppy). If the lexer sees some…
user377628
1
vote
1 answer

javac Jenkins Ant: build errors relating to dependent import.jars

I am having trouble building my Java src code via a Jenkins project using Ant. I am getting code from Git, then invoking an ant build.xml to build the src in a .class and then .jar. Simple enough, eh ?!!! When I build the Jenkins project, I get…
tebel
  • 23
  • 1
  • 8
1
vote
3 answers

Javac can't find class that does exist in package

I am new to java, and I am encountering an error that (after half an hour of searching) has not revealed itself. I have two classes (this is from me following a tutorial): Board.java: package skeleton; import javax.swing.JPanel; public class Board…
nebuch
  • 6,475
  • 4
  • 20
  • 39
1
vote
1 answer

Javac doesn't work in ant build

I try to run javac in ant build.xml on command line on ubuntu 11.02. After then running "ant deploy-live", the command line prints like: Compile failed; see the compiler error output for details. at…
user1548158
  • 61
  • 1
  • 3
  • 5
1
vote
2 answers

Does inner class need to be patched within outer?

I have parent class with some method doIt(...) and several inner classes. I have changed implementation of this method. Method signature left unchanged. Logic of that class is overcomplicated and I have no time to find out the call stack. After…
Viktor Stolbin
  • 2,899
  • 4
  • 32
  • 53
1
vote
1 answer

Why does java (maven) care about file timestamps during compilation?

I have a project that I have been working on for a few days and I finally got it to compile cleanly. However, a git clone of the same remote branch (on the same machine, compiled in the same terminal instance) caused a compilation error. A fresh…
matt5784
  • 3,065
  • 2
  • 24
  • 42
1
vote
1 answer

.class file doesn't have LineNumberTable

In our product there are a few jdk 1.6.0._17 compiled java source files. They are not giving the line numbers whenever there is an exception in any one of them. I used javap to find out more about the jdk 1.6.0._17 compiled classes. javap output…
Vijay
  • 101
  • 2
  • 5
1
vote
1 answer

Problems running java classfile from the folder

I have three source files in a folder. I simply want to compile them using commandline and then execute them. However, I'm having the following issue. I am on a windows box: Code compiles fine: C:\mycode\src\code>javac Source1.java Source2.java…
Anthony
  • 33,838
  • 42
  • 169
  • 278
1
vote
1 answer

Mysterious javac behavior: linux vs. windows

I have a peculiar situation. At one instant, I needed to branch, so I made a copy of my eclipse workspace and began working on two (2) parallel versions of the same project. Development is done on a Windows workstation. For testing purposes, the…
Martin
  • 1,385
  • 15
  • 21
1
vote
1 answer

Cannot use gcc which is set by autocmd to compile java in MacVim

I would like to compile my java program using gcc rather than using javac Because it can give out a more detail information compared to javac. In my startup configuration. I use "make" to help me compile my program so I have to set the compiler for…
code4j
  • 4,208
  • 5
  • 34
  • 51
1
vote
1 answer

Java compilation error loading classpath

I m trying to compile my java files . I understand using ant in this case , is the best solution. But my project is a one time deploy and I don't employ it using ant. Learning the basic would the basic time. I have a folder name Project and it…
user1141584
  • 619
  • 5
  • 16
  • 29
1
vote
1 answer

using javax.tools.JavaCompiler etc

I am looking for working examples of Oracle's Java Compiler API usage. I want to build something close to javac to customize/extend errors logging capabilities.
wilx
  • 17,697
  • 6
  • 59
  • 114
1
vote
2 answers

How to include default package in Ant javac Task

When I: It will no longer add compile and add the class…
Stephane Grenier
  • 15,527
  • 38
  • 117
  • 192
1
vote
1 answer

Compiler is creating extra class files with $ in them

I'm using Eclipse and I've written a Java application using SWT. When Eclipse compiles my program, it renames my main file into 4 different files like this: MainFile.class MainFile$1.class MainFile$2.class MainFile$3.class When I go to run this…
1
vote
1 answer

How to run and compile java program on hadoop 0.23.0 MR2

I created a .java file to run on cloudera hadoop. To compile it, javac -classpath $HADOOP_COMMON_HOME/share/hadoop/mapreduce/hadoop-mapreduce-client- core-3.0.0-SNAPSHOT.jar -d multifetch_classes MultiFetch.java Errors: MultiFetch.java:12:…
srikayala
  • 446
  • 6
  • 21