import chat.server not found - java

When I develop an RMI server, I use:
import java.rmi.server.UnicastRemoteServer;
import java.rmi.server.StubSecurityManager;
import chat.server.*;
But when I compile the Java file, an error occurs that says:
Class java.rmi.server.UnicastRemoteServer not found in import. import
java.rmi.server.UnicastRemoteServer
and also error with StubSecurityManager. Please help me work out this problem.

It appears that you are using an old code written in JDK1.1 trying to compile using newer version of JDK.
You need to make following changes.
java.rmi.server.UnicastRemoteServer -> java.rmi.server.UnicastRemoteObject
java.rmi.server.StubSecurityManager -> java.rmi.RMISecurityManager
Source:
http://groups.google.com/group/comp.lang.java.api/browse_thread/thread/c768d6617f80eedd/4edf4acebd2ce575

Related

HandwritingRecognitionOperation import from projectoxford is not working anymore

I am trying to run the sample app from Microsoft's cognitive service (computer vision). I am wondering why is the handwriting import not working? It says "cannot resolve symbol".
import com.microsoft.projectoxford.vision.contract.HandwritingRecognitionOperation;
import com.microsoft.projectoxford.vision.contract.HandwritingRecognitionOperationResult;
import com.microsoft.projectoxford.vision.contract.HandwritingTextLine;
import com.microsoft.projectoxford.vision.contract.HandwritingTextWord;
I solved my own problem by updating projectoxford library dependency on build.gradle file. I think the HandwritingRecognitionOperation class is available only at version 1.0.394.
//Add Library
compile 'com.microsoft.projectoxford:vision:1.0.394'

Should I download a library to import com.sun.pdfview.*?

When i decided to import com.sun.pdfview.* to my program it marked an error where it specified that I should create a package for it but when I did it still gave me an error, should I download a library to be able to use it? Which one?
ps.Im using eclipse as my IDE

The type android.support.v7.internal.widget.AdapterViewICS is not visible

I am trying to import the following class for an android project
import android.support.v7.internal.widget.AdapterViewICS.OnItemClickListener;
But I get an error "The type android.support.v7.internal.widget.AdapterViewICS is not visible" All my other imports are working fine thus far and I am using the android ADT bundle downloaded directly from google.
I've got a similar problem after a git merge and, probably, Eclipse being crazy about packages auto-import.
Just replace
import android.support.v7.internal.widget.AdapterViewICS.OnItemClickListener;
with
import android.widget.AdapterView.OnItemClickListener;
The original AdapterView is supported since API Level 1 thus you will not break the app on old devices.
replace the import statement"import android.support.v7.internal.widget.AdapterViewICS.OnItemClickListener;" with "import android.widget.AdapterView.OnItemClickListener;",sometimes Eclipse cannot find the right packages for auto import.

JavaFX Import Error for javafx.builders package

I am learning JavaFX from Pro Java FX 2 book. I am trying to import javafx.builders.* package. but compiler keeps raising errors import cannot be resolved. but other packages javafx.* excepts javafx.builders.* imports successfully. I am using JavaSDK 7u51. I tried in eclipse with e(fx)clipse and Netbeans as well. Please help me to find solution.
There is no such package as javafx.builders. Each builder is (generally) in the package of the class it builds, for instance GroupBuilder is in javafx.scene, as:
import javafx.scene.GroupBuilder;

Java missing libraries

I'm using Eclipse on Mac OS X 10.6.6.
For some reason when I'm trying to import the following libraries I get this error:-
java.apt (only java.apt.font is available)
javax.swing
The system is fully updated with the recent updates
Thanks in advance
Are you doing
import javax.swing;
or are you doing
import javax.swing.*;
The difference is very important.
As a general rule, I try to import only the exact classes I need.

Categories