How to add 3rd party JAR's to compile time cla

2019-02-19 14:39发布

问题:

What do I need to do to successfully the import ij package? I get an error:

ITCN_.java:1: package ij does not exist

The imports are:

import ij.*; 
import ij.io.*;
import ij.gui.*; 
import ij.process.*; 
import ij.measure.*; 
import ij.plugin.*; 
import ij.plugin.frame.*; 
import ij.plugin.filter.PlugInFilter;

import java.io.*; 
import java.awt.*; 
import java.awt.event.*;
import java.util.*; 
import java.lang.*; 
import java.text.*;

回答1:

It's the ImageJ API. The API docs are available here. You can download it here. Once downloaded, just add the JAR(s) to the compiletime and runtime classpath.



回答2:

I also used Jgrasp back in the day.

I highly recommend moving to eclipse although jGrasp is very simple and works.

To Add to the Build Path you go to Settings -> PATH/CLASSPATH -> Workspace

Click on the "Path" tab, and then the "CLASSPATHS" subtab.

Then Click "New" and where it says Path or Jar file, enter in the path to the ij jar file. Do this for each file if there are more than one.

And then click "apply" and you should be able to use import ij.* and the subsequent functions



标签: java import