1

I am trying to compile a java file on windows that contains an import statement to classes inside another jar file.

The classes inside the jar file is compiled with java version 1.5, and the javac command is using java version 1.7.

What would be the correct syntax for the javac command to include the referenced jar file?

It does not seem to matter what I do, it just fails with a package does not exist exception.

Thanks!

user955732
  • 1,330
  • 3
  • 21
  • 48
  • See here [javac classpath](http://stackoverflow.com/questions/2096283/including-jars-in-classpath-on-commandline-javac-or-apt) summary: java -cp jar1:jar2:jar3:dir1:. HelloWorld – Trudbert Aug 20 '14 at 06:11
  • not working: javac -cp .:myJar.jar:. Test.java Test.java:1: error: package bla.bla.bla does not exist import bla.bla.bla; – user955732 Aug 20 '14 at 06:22
  • not working: javac -cp "lib/\*:." Test.java Test.java:1: error: package com does not exist import com.*; – user955732 Aug 20 '14 at 06:29
  • not working: javac -cp "lib/myJar.jar:." Test.java Test.java:1: error: package com does not exist import com.*; – user955732 Aug 20 '14 at 06:30

0 Answers0