Reputation: 37
I'm trying to compile a project with javac in windows, but I'm getting a "package x does not exist" error.
Even if the jar file containing them is in the classpath.
Here is the command, I just added line returns to make it readable:
javac
-d bin
-sourcepath src
-cp
.;
lib/gson-2.5.jar;
lib/jruby-complete-9.1.2.0.jar;
lib/lwjgl-platform-2.9.3-natives-windows.jar;
lib/lwjgl-platform-2.9.3-natives-linux.jar;
lib/lwjgl-platform-2.9.3-natives-osx.jar;
lib/jinput-platform-2.0.5-natives-windows.jar;
lib/jinput-platform-2.0.5-natives-linux.jar;
lib/jinput-platform-2.0.5-natives-osx.jar;
lib/lwjgl.jar;
lib/lwjgl_util.jar;
lib/jorbis-0.0.17.jar;
lib/jinput-2.0.5.jar;
lib/gdx-platform-1.9.2-natives-desktop.jar;
lib/gdx-controllers-platform-1.9.2-natives-desktop.jar;
lib/gdx-freetype-platform-1.9.2-natives-desktop.jar;
lib/gdx-1.9.2.jar;lib/gdx-backend-lwjgl-1.9.2.jar;
lib/gdx-controllers-1.9.2.jar;
lib/gdx-controllers-desktop-1.9.2.jar;
lib/gdx-freetype-1.9.2.jar;
lib/jlayer-1.0.1-gdx.jar;
lib/jutils-1.0.0.jar
src/com/azias/awbe/Launcher.java
And here is the error message:
src\com\azias\awbe\Launcher.java:3: error: package com.badlogic.gdx.backends.lwjgl does not exist
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
^
src\com\azias\awbe\Launcher.java:4: error: package com.badlogic.gdx.backends.lwjgl does not exist
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
^
src\com\azias\awbe\Launcher.java:16: error: cannot find symbol
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
^
symbol: class LwjglApplicationConfiguration
location: class Launcher
src\com\azias\awbe\Launcher.java:16: error: cannot find symbol
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
^
symbol: class LwjglApplicationConfiguration
location: class Launcher
src\com\azias\awbe\Launcher.java:27: error: cannot find symbol
new LwjglApplication(new AdvanceWarsBootleg(), config);
^
symbol: class LwjglApplication
location: class Launcher
src\com\azias\awbe\AdvanceWarsBootleg.java:3: error: package com.badlogic.gdx does not exist
import com.badlogic.gdx.Game;
^
src\com\azias\awbe\AdvanceWarsBootleg.java:4: error: package com.badlogic.gdx.graphics.g2d does not exist
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
^
src\com\azias\awbe\AdvanceWarsBootleg.java:6: error: cannot find symbol
public class AdvanceWarsBootleg extends Game {
^
symbol: class Game
src\com\azias\awbe\AdvanceWarsBootleg.java:7: error: cannot find symbol
public SpriteBatch batch;
^
symbol: class SpriteBatch
location: class AdvanceWarsBootleg
src\com\azias\awbe\AdvanceWarsBootleg.java:9: error: method does not override or implement a method from a supertype
@Override
^
src\com\azias\awbe\AdvanceWarsBootleg.java:17: error: method does not override or implement a method from a supertype
@Override
^
src\com\azias\awbe\AdvanceWarsBootleg.java:19: error: cannot find symbol
super.render();
^
symbol: variable super
location: class AdvanceWarsBootleg
12 errors
Upvotes: 1
Views: 5836
Reputation: 938
Using Java 6 or later, the classpath option supports wildcards. Note the following:
Use straight quotes (")
Use *, not *.jar
so you could simplify your javac statement:
javac
-d bin
-sourcepath src
-cp ".;libs/*"
src/com/azias/awbe/Launcher.java
Also depending on the platform the separator is ;
(windows) or :
(unix).
Upvotes: 1