0

When I run javac on an ubuntu linux system I get a "package does not exist" error from the line

import org.voltdb.ProcInfo

From the answer below, I know that I need to add packages from "org/voltdb/ProcInfo" to my javac class path to resolve this error. Java Package Does Not Exist Error

But when I search for the system for such a directory structure I don't find it.

prompt$cd / 
prompt$sudo find / -type d -path 'org/voltdb/ProcInfo' //returns no output

I downloaded VoltDB community edition 3.5 and am trying to compile and run a voltdb project. It seems unlike that Volt's .tar does not include the necessary java libraries -- but that seems to be what is going on. Am I understanding what is happening correctly or am I missing something? I have only working knowledge of Java and Linux.

Community
  • 1
  • 1
bernie2436
  • 22,841
  • 49
  • 151
  • 244
  • That file path will only exist if you unzip their JAR. – nickb Oct 08 '13 at 01:37
  • @nickb there are tons of .JARs that came with volt. How do I know which one contains this class path. – bernie2436 Oct 08 '13 at 01:39
  • You can unzip them all and to the search, but there could be interdependencies between the JARs. Easiest solution is to add all of the jars to the classpath with a wildcard - /path/to/volt/*.jar – nickb Oct 08 '13 at 02:01
  • 1
    @nickb if I do that, do I still need to unzip the jars or will javac be able to "see into" the jars to learn what files they hold? – bernie2436 Oct 08 '13 at 02:02
  • You shouldn't unzip JARs for your project. If you need to import them in your Java code, add them to your classpath (for BOTH javac to compile, and java to execute). – nickb Oct 08 '13 at 02:05
  • @nickb so I should not worry about the file path not existing. I just need to include the .jars in the classpath. Correct? Thanks for your help – bernie2436 Oct 08 '13 at 02:06
  • Yes, correct. This may also help - http://stackoverflow.com/questions/1064481/how-to-wildcard-include-jar-files-when-compiling – nickb Oct 08 '13 at 02:07

1 Answers1

1

You need to add the VoltDB .jar file to the classpath

dkatzel
  • 31,188
  • 3
  • 63
  • 67