i'm having trouble compiling java source file on linux. source file (petersteam.java) imports classes jar stored in same file location source. i'm getting errors stating packages containing classes not exist. i've tried many different variations of command below found online, none seem work. appreciated.
javac -cp testjar.jar petersteam.java here imports match package structure in jar:
import org.gamelink.game.cram; import org.gamelink.game.algo; here errors:
petersteam.java:1: error: package org.gamelink.game not exist import org.gamelink.game.cram; ^ petersteam.java:2: error: package org.gamelink.game not exist import org.gamelink.game.algo; ^ update: jar tvf testjar.jar command getting:
0 tue jul 14 11:17:46 edt 2015 meta-inf/ 68 tue jul 14 11:17:46 edt 2015 meta-inf/manifest.mf so i'm assuming did wrong when making jar here command used , there wrong it?
jar -cvf testjar.jar *.class
it sounds problem way created jar file - assuming did @ root of class hierarchy (which should) should have used:
jar -cvf testjar.jar org/gamelink/game/*.class ... there shouldn't any class flies in directory in you're running jar.
Comments
Post a Comment