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

Compile legacy Java code with java1.6 JDK

I'm compiling many legacy Java code probably written with Java1.3 and I got tons of errors like this: Copydir.java:128: warning: as of release 5, 'enum' is a keyword, and may not be used as an identifier [javac] (use -source 5 or higher to use…
Andy Liu
  • 11
  • 2
1
vote
2 answers

how to handle a command-line input like "java.exe program < s1.in"

I know how to use string args to get the input from the command-line, and it is working fine with input = args[0] where my input is java.exe program s1.in But I need to run a compare program in terminal. So my input must have the "<" symbol.…
IanIsAFK
  • 77
  • 2
0
votes
3 answers

Javac not working properly or am I doing something wrong?

I've gotten my friend's project folder that a bunch of .java and .class files so that I could help him with his project. We are using git as our way of version control. In the directory, I typed "javac *.java" but unfortunately I got a bunch of…
Java Confused
  • 153
  • 1
  • 2
  • 6
0
votes
6 answers

How many files does the java compiler create?

If I compile a class class hussi { public static void main(String args[]) { System.out.println("hello java"); } } Will I have any file other than hussi.class file? Does the javac create any file other than .class file ?
0
votes
3 answers

No main found when executing jar

http://pastebin.com/1btVw8Cb There are two classes in the above code. So above is my code which is working fine when I hit run in Eclipse, runs fine in Netbeans as well. I am trying to create a standalone application, a jar file. The error I get…
Noman Arain
  • 1,172
  • 4
  • 19
  • 45
0
votes
3 answers

Declare external libraries in Java - Compiling Error

I can't compile my Program.java from the command line (only in Eclipse). When I want to compile it with javac Program.java "cannot find symbol" errors occur at JUnit classes. Eclipse has the JUnit classes in it's plugins, but to compile it on my…
Arian
  • 3,183
  • 5
  • 30
  • 58
0
votes
1 answer

How to make JavaC copy existing class files to the target dir?

I hope somebody can give me an advice... Problem In source directory of my project some packages contain resources which are not ".java"-files. Now I need to put there compiled ".class"-files. The problem is that ANT filters them out when I am…
Andrej
  • 1,679
  • 1
  • 26
  • 40
0
votes
1 answer

I cannot include the jar files in my project

I tried to use a sourceforge library in my program. On my computer I use Eclipse, and I easily add the jar files to my project. Now, I want to move the code to another computer. I tried an executable jar file, but the problem is I cannot debug it…
Afshin Moazami
  • 2,092
  • 5
  • 33
  • 55
0
votes
3 answers

java Makefile issue

For a homework assignment I have to make a makefile (physically and in software) for a series of .java files that I have written. I have written up a make file: JFLAGS = -d -g bin/ JC = javac .SUFFXES: .java .class CLASSES = \ …
ChristianB
  • 153
  • 3
  • 13
0
votes
1 answer

javac error while executing Java with Spring console based application

I am trying to execute a Java with Spring application from console/DOS prompt. Here are the steps I've followed: Downloaded spring-framework-3.1.0.RELEASE and unzipped it as well. Created a folder called 'springlib' on F:. Copied all the files…
Faisal
  • 645
  • 3
  • 11
  • 24
0
votes
1 answer

Java Executing Error

I have struggled for almost 2 days now with my java. Since I'm taking a computer science class, we will have to start without programming in an IDE. First of all I had the problem with the "javac" command which I managed to solve, everything worked…
Dannzor
  • 11
  • 3
0
votes
3 answers

Minecraft compiling .java to .class illegal characters & unclosed character literal

I am using the javac with command prompt to compile my .java to .class. This is for minecraft if it helps... Here are the errors I am receiving : C:\java\eh.java:269: unclosed character literal /* 284 */ char c = '─Æ'; …
Connell
  • 11
  • 3
0
votes
3 answers

Do not understand following use of -classpath by javac

I am not very clear with the following question from SCJP Book (I read the solution and explanation though) .. Consider the following directory structure :- foo --> test --> xcom --> A.class, B.java Here foo, test and xcom are directories. A.class…
whitehat
  • 2,381
  • 8
  • 34
  • 47
0
votes
4 answers

How can I compile "import pack.*" with ant/javac, when there are no such classes?

For my company, I'm making a batch script to go through and compile the latest revisions of code for our current project. I'm using Ant to build the class files, but encountered a strange error. One of the source files imports .* from a directory,…
Monster
  • 1,573
  • 6
  • 23
  • 35
0
votes
3 answers

Problem with dependencies using Ant from the shell

I'm having problems building my project, using an Ant script, from the command prompt using Ant itself. It can't find a certain import for a particular Java file in my project (which has nearly 5,000 source files as it is). The import is included in…
Monster
  • 1,573
  • 6
  • 23
  • 35