Compiling Java files with the dependent jars using windows Cmd -


i have 5 .java files in src folder , many dependent jars in lib folder while compiling .java files jars facing error as,

src\grapher.java:12: error: package org.jfree.chart not exist import org.jfree.chart.*;

my directory sturcture is,
c:\grapher\src*.java
c:\grapher\lib*.jar

i using commond javac -cp .;lib/*.jar src/*.java

  1. make sure have jfreechart jar in lib folder
  2. you have wrap arguments of -cp brackets
  3. you didn't provide sourcepath.

try this:

javac -classpath "lib/*" -sourcepath src src/*.java 

note: work if java files located in src folder. in case if have package declaration in classes have specify package structure.

eg: src/com/company/*.java


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -