Eclipse how to add downloaded files to project






















This particular Java project is adapted from the textbook Algorithms by Robert Sedgewick. In addition, the examples below use a PC, though the process is nearly identical on a Mac. Obtain the Java files you wish to install to Eclipse by downloading them from their source. The files will be in a zip file. The workspace directory folder and its Java project subfolders will be placed in this location. Extract the contents of the downloaded zip file into the folder created in Step 2.

Disclaimer : Eclipse is a complex software that often takes a few minutes to initialize. Drag and Drop to add files. Like this: Like Loading What do you think? Cancel reply Enter your comment here Fill in your details below or click an icon to log in:. Email required Address never made public.

Name required. Follow Following. MCU on Eclipse Join 2, other followers. Remember to do this for every project that needs this library! If you have to test your Java code on the lab computers via the command-line, you may run into problems since the third-party library may not be included in your jar file.

You can bundle the third-party library in your jar file, but this will often result in very large jar files. If you just need to run your program once, it may be easiest to use the -cp flag to specify all of the locations to find your class files.

The format is as follows:. If you get a java. NoClassDefFoundError exception, then it is likely you did not specify all of the jar file locations or forgot to include a class in your jar file. If you want to include those libraries in your classpath, you need to open the file. You can also setup your classpath to include any jar files in the current working directory by also adding this line:.

If you see something similar to above, you should be able to run your Java code without a problem at least, without any problems caused by missing third-party libraries. Improve this answer. Kevin Day Kevin Day In fact this could cause some very confusing behaviors in Eclipse. This solved my problem similar. I'd like to add that if you get the error "Failed to load main setting" or something similar. Thotman Thotman 1 1 silver badge 2 2 bronze badges.

Maybe one or the other may work for you. This assumes Eclipse and an appropriate JDK are installed on your system Open Eclipse and create a new Workspace by specifying an empty directory. This should be the directory that contains "com" Click Finish. For this particular project you don't need to do any additional setup for your classpath since it only depends on classes that are part of the Java SE API.

Mike Deck Mike Deck Hrqls Hrqls 61 1 1 silver badge 1 1 bronze badge. The Overflow Blog.



0コメント

  • 1000 / 1000