Reputation: 48525
I'm following a guide that only includes compilation instructions on windows. How would one run this build.bat
file on Linux?
The batch file looks like this:
@echo off
@echo Compiling...
javac -classpath ..\..\lib\OneWireAPI.jar;%classpath% -d . .\src\*.java
And when I run the javac
command on Linux, it fails:
javac -classpath ../../lib/OneWireAPI.jar;%classpath% -d . ./src/ReadTemp.java
The output is:
javac: no source files
What is the correct way to do this?
Upvotes: 1
Views: 142
Reputation: 114350
You have two items that did not get translated correctly from Windows CMD to Unix:
;
should be :
.%classpath%
to $CLASSPATH
format. Note that pretty much everything is case-sensitive in Linux, including environment variable names, and the Java path is traditionally all-caps.Try
javac -classpath ../../lib/OneWireAPI.jar:$CLASSPATH -d . ./src/ReadTemp.java
Upvotes: 1
Reputation: 1474
On Linux, you have to use :
(colon) in place of ;
(semicolon) as the path separator in Java options.
Also, if you have a classpath
variable, in most common Linux shells it is referenced by $classpath
rather than by %classpath%
javac -classpath ../../lib/OneWireAPI.jar:$classpath -d . ./src/ReadTemp.java
Upvotes: 1