When I am coding in Eclipse I don't have errors, but when I try compiling the code I just made with a batch compiler, I get these errors: Alert.java
Compiler.bat code
javac -d bin -sourcepath src/*.java src/sign/*.java
pause
.classpath file
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="output" path="bin"/>
</classpath>
In order to compile your project you have to
create a text file listing all your java files. For example, compile-list.txt
:
src/MyClass1.java src/mypackage/MyClass2.java ...
Run javac
specifying source and target version and the file with your classes:
javac -source 1.7 -target 1.7 -d bin @compile-list.txt
Specifying -sourcepath src
would allow javac
to resolve unlisted (forgotten) classes from the source directory, in case they are needed.
Since this is extremely unhandy process I would recomment to use Ant or Maven .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.