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

How javac -s option works

I was trying to find an example usage of the -s option for the java compiler but failed. Could anyone explain or give me an example on how the -s option works? The Oracle document has the following explanation: Specify the directory where to place…
1
vote
2 answers

IllegalArgumentException Invalid flag using the java compiler pragmatically

I'm trying to compile java files within my java application however they need to be compiled with additional classes which aren't in the class path. So in my code I put in the options like so: Iterable options = Arrays.asList("-classpath…
Dean
  • 8,668
  • 17
  • 57
  • 86
1
vote
2 answers

Using Java-Insipired Language in Android App

Here is my situation. I am using a custom programming language thats syntax is based on Java. In order to compile this *.custom file I use the java classpath to locate the .jar that contains the .class files. This converts the .custom to .java from…
1
vote
2 answers

actual argument cannot be converted by method invocation conversion

What is the correct way to add a char to charQueue which is a final ConcurrentLinkedQueue parameter? Oracle seems to say that it should work: From type char to type…
Thufir
  • 8,216
  • 28
  • 125
  • 273
1
vote
3 answers

Overloaded package-private method causes compilation failure - Is this a JLS oddity or javac bug?

I've come across an oddity of the JLS, or a JavaC bug (not sure which). Please read the following and provide an explanation, citing JLS passage or Sun Bug ID, as appropriate. Suppose I have a contrived project with code in three "modules" - API -…
noahlz
  • 10,202
  • 7
  • 56
  • 75
1
vote
1 answer

Dynamic Compilation in Memory for Java for classes and classes that have dependencies on those classes

I have a List of class names and class source code. I need to compile in memory these classes so I can use them in the program. Compiling a class is fine, except when that class requires another class that has to be compiled. For example, if I have…
TheDog
  • 355
  • 3
  • 12
1
vote
1 answer

Building Java Project with Hadoop-LZO but cannot find class

I'm trying to build a simple WordCount jar project which utilizes Hadoop-lzo library but cannot seem to get the following command to work, even though the class I'm referencing is within hadoop classpath: $ javac -cp `hadoop classpath`…
Carl Sagan
  • 982
  • 1
  • 13
  • 34
1
vote
3 answers

javac is not working even after setting the path in windows xp

Friends I couldn't access java in my xp even after i set the path i set the path as set path="C:\Program Files\Java\jdk1.7.0_25\bin" It doesn't work in xp But it is useful in my windows 7 System Don't know why Please answer me I also set path…
Vaisakh Pc
  • 714
  • 8
  • 21
1
vote
2 answers

javac -d option, how does it know which directory to go in?

Hi I have the following directory structure... I enter this at terminal: javac -d bin src/com/elharo/math/Fraction.java and the Fraction.class file gets placed in bin/com/elharo/math instead of bin/ I just wondered why the compiler placed the…
jimbo123
  • 289
  • 3
  • 7
  • 13
1
vote
1 answer

How to check for missing @Override annotations with Maven

I've a maven project in which, I'm sure, there are classes which need and don't have @Override annotations. Is there a way to configure maven compiler plugin to show a warning on missing @Override annotations? I'm using Netbeans but I would prefer…
andPat
  • 4,153
  • 7
  • 24
  • 36
1
vote
1 answer

error: package javax.servlet does not exist/ directory not found

tomcat -webapps -Servlet -WEB-INF -lib -classes -cc -openhome -HelloServlet.java in cmd , C:\tomcat\webapps\Servlet>javac -classpath…
user2460718
  • 55
  • 1
  • 2
  • 10
1
vote
2 answers

Eclipse showing "Unable to find a javac compiler" even though the installed JRE is 1.6 on building using Gradle

In eclipse, the installed JREs having only JDK1.6 and nothing else. But on building the project using gradle, i'm getting the following error. Caused by: : Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps…
Sarath
  • 1,438
  • 4
  • 24
  • 40
1
vote
1 answer

Compiling Junit on windows 8 command line error

I created a Junit test case using Eclipse and it works fine. I am trying to compile it using command line but can't seem to do it. I was able to "compile" it fine..but now when I try to run it I get the following error: JUnit version…
user1411893
  • 608
  • 2
  • 8
  • 19
1
vote
5 answers

How to compile java code?

I have a bunch of java files and I am running the following code in an attempt to compile them. "\Program Files\Java\jdk1.6.0_16\bin\javac" Main.java And I am being shown this error message Main.java:3: package colourtiler.patternsdoes not exist…
Ben Waterman
  • 61
  • 2
  • 3
1
vote
1 answer

Compile all files in src?

Here's what I've got: /myjava/compile.cmd /myjava/src/a/HelloWorld.java /myjava/src/b/Inner.java /myjava/src/b/Inner2.java /myjava/bin HelloWorld: package a_pack; import b_pack.Inner; import b_back.Inner2; public class HelloWorld { public…
dwjohnston
  • 11,163
  • 32
  • 99
  • 194