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

Execute two seperate classes with one single java command

Is it possible to execute two separate classes with one single java command? I would like to run a few java programs concurrently (it should start at the same time) for my project. Example: I have two java programs A.java and B.java. Compile javac…
N2M
  • 199
  • 1
  • 15
1
vote
1 answer

Sublime Text 2 - Out of the box Compiling and running Java programs

OS: Distributor ID: Ubuntu Description: Ubuntu 12.04.2 LTS Release: 12.04 Codename: precise Sublime Text 2 is 2.0.1 for Linux 32-bit There is JAVA_HOME set up in my environment and JAVA_HOME/bin included in $PATH $ cat /etc/bash.bashrc …
Jignesh Gohel
  • 6,236
  • 6
  • 53
  • 89
1
vote
1 answer

Ant javac difference between target and source attributes?

I have Java 6 and 7 installed. How do I specify ant to use Java 6 to compile? I've seen some threads that set the java 6 compiler path, and that worked, but I also saw threads like this Setting the target version of Java in ant javac which set a…
Raekye
  • 5,081
  • 8
  • 49
  • 74
1
vote
1 answer

How do I solve javac compiler error, "package com.sun.tools.internal.ws.processor.model does not exist"?

I'm seeing a bizarre error when I do a Maven build, launched through Jenkins, using Java 6. I get errors during my test-compile phase, which are [ERROR] /scratch/jenkins/workspace/subco/subco/myproject/src/test/java/org/mainco/subco/ebook/mvc/ …
Dave
  • 15,639
  • 133
  • 442
  • 830
1
vote
2 answers

interesting issue about @Override with interface

Just got interesting issue with compiling class file with @Override annotation on method which implements interface method. I tried to set up moquette project in eclipse and got compile error Description Resource Path Location Type The…
michael nesterenko
  • 14,222
  • 25
  • 114
  • 182
1
vote
0 answers

maven unable to find java compiler

I'm new to maven. I just joined a new company and they use maven for all their projects. I set up the company's server for maven dependencies. I'm using Fedora. For most of the projects everything goes well. For some of them I get this error when…
Emil Salageanu
  • 997
  • 1
  • 10
  • 24
1
vote
0 answers

How to specify manifest when using javac in ANT

I have a jar, including the manifest pointing a bunch of jars. I was trying to use javac in ANT to compile the source files. The problem is how to let ANT know this jar is just a manifest, so that it can find the correct the jars by following this…
1
vote
2 answers

Is it possible for a Java source file to run arbitrary code when compiled?

Is it possible for me to structure a Java source file such that, when compiled with javac (but not invoked with java) it will run arbitrary code? Or can I assume that it's safe to run arbitrary source files through javac?
cdmckay
  • 31,832
  • 25
  • 83
  • 114
1
vote
2 answers

Specifying name for compiled class with javac

I have a class called fence.java and after compilation with javac the .class file is named fence.class, but I want it to be called p1. When compiling C files with gcc I am able to do this by using the -o option but for javac I haven't been able to…
1
vote
1 answer

VerifyError when build with ant, OK when build from Eclipse

My java project for Android has several configurations. Previously I switched them and build apk from eclipse manually, but recently I've developed several ant tasks to make my life much easier: I launch cmd file and it builds all the configurations…
Tertium
  • 6,049
  • 3
  • 30
  • 51
1
vote
1 answer

IntelliJ Idea 12: Specify which javac when using External Build

I've been a long-time Eclipse user, but at the suggestion of a few coworkers I've begun playing around with IntelliJ IDEA 12, and I love it. Though I'm having an issue with the External Build option, namely, it doesn't seem to utilize the javac…
Doug Stephen
  • 7,181
  • 1
  • 38
  • 46
1
vote
1 answer

How to build java project with command-line arguments in IntelliJ

I have a java test project which has two binary fields.when I want to compile the project in IntelliJ,it complains that I should use -source 7 instead of -source 1.6 while compiling.my JDK is the latest.I don't know how to fix this. sample…
Ramin Omrani
  • 3,673
  • 8
  • 34
  • 60
1
vote
2 answers

Set a default value for fork in javac ant

I have a requirement of using fork=true through out my build. i am looking at setting it globally and use it across my build machine. Help appreciated.
Pavan
  • 9
  • 3
1
vote
1 answer

Ant test compile cant find main classes

I have an Ant build that is compiling my main classes correctly, but failing when it goes to compile my test classes, because it cannot find the symbols for any of my main classes: Project directory structure: MyProj/ src/ main/ …
user1768830
1
vote
4 answers

ArrayList object stored in List variable

I am newly learning java.I am trying to understand the various data structures in util package. /*create an ArrayList object*/ List arrayList = new ArrayList(); In the decleration of ArrayList class I have seen public class…
liv2hak
  • 14,472
  • 53
  • 157
  • 270