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
1 answer

javac: incompatible types required: classname found: classname

The following code compiles in JDK6. Fails in JDK7 with compilation error. java: incompatible types required: com.jdk7.IExporter found: com.jdk7.IExporter Compiler is 1.7.0_10, from Oracle. $ javac -version javac…
Jayan
  • 18,003
  • 15
  • 89
  • 143
1
vote
1 answer

Ant javac classpathref not working?

The javac task in my compile target fails despite the required jars being on the classpath. Could anyone help me figure out why this is happening? The error below is caused because IOUtils.lineIterator() is not recognized. However,…
mauryat
  • 1,610
  • 5
  • 29
  • 53
1
vote
1 answer

javac @ and encoding

I'm trying to compile some java files on my computer under Windows 7 in french; and I thing I have some trouble with file endoding... In a first step, I'm generating a list of the file to compile: dir src\*.java /B/S > javasrc.tmp~ Which will wrote…
Alexxx
  • 766
  • 1
  • 11
  • 19
1
vote
1 answer

How to restrict application between minor and major version of Java SDK?

In an Interview, Interviewer asked me this question that how to restrict an application developed in java between a minor version and major version. I know about -target options as Cross-Compilation Options but not sure about the restricted…
Shashi
  • 12,487
  • 17
  • 65
  • 111
1
vote
1 answer

Error in invoking javac on Debian Squeeze

We have a third-party Java app that uses a Jetty server but looks like either the JDK is missing or not reachable where it is located? In /usr/bin I see: java javaws jexec No javac so probably no JDK installed. The box is Debian "Squeeze" with the…
Slinky
  • 5,662
  • 14
  • 76
  • 130
1
vote
6 answers

How clever is javac?

If I were to compile the following code with javac, would the compiler be clever enough to only evaluate codeInput.length() once, or would I potentially get a faster program by putting the evaluations affected by the iterator variable first? //…
Eamon Moloney
  • 1,853
  • 4
  • 19
  • 22
1
vote
1 answer

Maven Java Compile is too slow

I am facing a peculiar problem where my java source files just takes too much time to compile. The Maven debug output at the point the install gets stuck is given below. It takes as much as 10 minutes to compile a single Java file. This was working…
ArunM
  • 2,274
  • 3
  • 25
  • 47
1
vote
2 answers

"javac: file not found" if path is quoted

I built an application to compile and run java files and it was running completely ok. Since it is the user to choose the path of java files to be compiled and executed, i quote the path, so that it can contains white spaces and special characters.…
mariofalcao
  • 61
  • 1
  • 1
  • 5
1
vote
2 answers

linux to compile multiple java file

here is my directory structure. /user/a /user/b /user/b inside folder a,b,c there is a file person.java (it is the Same file, just a one line modification. now, on my shell, im on my /user/ directory and i try to do javac */person.java the…
freshWoWer
  • 61,969
  • 10
  • 36
  • 35
1
vote
2 answers

How do you specify a main class in a manifest file when compiling from the parent directory?

My directory structure is like this: > makefile > app.jar > src > Main.java > Main.class > some other classes > manifest.txt I compile from the makefile with these commands: javac src/*.java jar cvfm app.jar src/manifest.txt…
Nick Brunt
  • 9,533
  • 10
  • 54
  • 83
1
vote
1 answer

xmlbeans-maven-plugin not finding javac

I am trying to setup xmlbeans-maven-plugin 2.3.3 in my Eclipse and while everything seems to go OK, It fails with an java.io.IOException due to inability to find the file C:\Users\Daniel\Workspace\MyProject\javac. This is strange because javac is on…
Withheld
  • 4,603
  • 10
  • 45
  • 76
1
vote
2 answers

javac makefile re-compiling on every 'make'

Any idea why this makefile would re-compile (unnessesarily so) each .class file? Also, I think it is relevant, the java files import the files above them. I've tried this 4 times and wasted hours to get this to work, instead of working on the actual…
Gagan Singh
  • 988
  • 12
  • 22
1
vote
2 answers

javac -cp parameter's error "javac: file not found:"

My question is about one of the basic java command "javac". I have a ".java" file on my desktop.I have installed JDK 7 and added path variable to the environment variables. Here is the screenshot of the "environment variables".…
ACrescendo
  • 46
  • 10
1
vote
2 answers

How can one request a debug build from javac without changing the ant scripts?

I have a complex build system involving many ant scripts, some targets of which invoke the javac task. These ant scripts do not provide for a way to request a debug build from javac, i.e. neither debug nor debuglevel parameters of the javac task are…
mark
  • 59,016
  • 79
  • 296
  • 580
1
vote
3 answers

AdaptRecursive StackOverflowError

While compiling my project I get: The system is out of resources. Consult the following stack trace for details. java.lang.StackOverflowError at com.sun.tools.javac.code.Type$WildcardType.isSuperBound(Type.java:435) at…
Etam
  • 4,553
  • 10
  • 40
  • 60