The package javax is not accessible - java

import javax.speech.*;
import javax.speech.recognition.*;
I get an error saying (see title), because of these.
Where do I get javax and I've see there are different versions which do I get.
Thanks

Related

java.util.logging does not exist bug?

I am trying to import java.util.logging into my class but it doesn't exist.
I am using Netbeans 8.2 installed just a few weeks ago, when I started learning Java and Netbeans.
I found this old bug report Bugzilla report but this is so old, I would expect it to be fixed, especially for a logging function.
The following is the only code I have in the class file. The 2 java.awt classes import OK. I added those just to prove that I had access to the standard Java library. The auto suggest does not suggest anything starting with log...
package myflag.flag.logging;
import java.util.logging;
import java.awt.Color;
import java.awt.Font;
Any ideas please???
Only a type can be imported. java.util.logging is a package. Please specify directly what class you need to import or you can import like this for all class inside this package: import java.util.logging.*;

MultiPartEntityBuilder cannot be resolved to a type

I used a newer class to substitute a deprecated one. The class is MultiPartEntityBuilder. When i wrote it in the code, the compiler suggested me to import the following package
import org.apache.http.entity.mime.MultipartEntityBuilder;
I have imported it. But the compiler cannot still find it, giving me the error on the title
MultiPartEntityBuilder cannot be resolved to a type
So, it sounds quite strange to me. I've already succesfully imported similar packages
import org.apache.http.entity.mime.HttpMultipartMode;
import org.apache.http.entity.mime.MultipartEntity;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.entity.mime.content.ContentBody;
import org.apache.http.entity.mime.content.FileBody;
import org.apache.http.entity.mime.content.StringBody;
Does it mean i have an old version which doesn't define any class named MultiPartEntityBuilder ?
How does the compiler know that i should import that class, part of that package, if he got an old version of that package?
Please note that
import org.apache.http.entity.mime.MultipartEntityBuilder;
is market as an error.
Upload Apache HttpClient Mime 4.3.1 jar file http://mvnrepository.com/artifact/org.apache.httpcomponents/httpmime/4.3.1
It means that org.apache.http.entity.mime.MultipartEntityBuilder isn't accessible during compilation time. You should add it to your project somehow depends on your build tool.
Looks like a spelling error, you had MultiPartEntityBuilder instead of MultipartEntityBuilder. The "P" shouldn't be capitalised.

what does it mean when there is import error?

I am using a code sample that suppose to be working, but I keep get an error with those 3 import statement.
import com.amazonaws.services.s3.transfer.internal.MultipartUploadCallable;
import com.amazonaws.services.s3.transfer.internal.PutObjectCallable;
import com.amazonaws.services.s3.transfer.internal.TransferStateUpdatingCallable;
the error message says : The import com.amazonaws.services.s3.transfer.internal.MultipartUploadCallable cannot be resolved
why is that happening and how can I solve it ?
Please add jars that contain this classes. This will always solve your problem.
This means that implementations of referenced classes cannot be found in classpath. Since you are using amazonaws you should add appropriate library to your project's dependencies.

Import issue in Eclipse

I have the following import in my java code in an eclipse project
import org.jscience.*;
However upon writing the code
Real r1 = new Real.valueOf(1);
I receive the error
Real cannot be resolved to a type
I am puzzled as to why this is happening as I am correctly importing (or so I believe)
Also to note, eclipse suggests using
import org.jscience.mathematics.number.Real;
But I am trying to avoid using the import for the full class location within the Jar.
Any ideas?
Thanks in advance
Martin
Try
import org.jscience.mathematics.number.*;
Because
import org.jscience.*;
will actually only import classes from within the jscience package and not any subpackages.
If we suppose your import is not throwing errors, try importing g.jscience.mathematics.number.*.

Which version of Netty API does this example code use? Unable to resolve io.netty.handler.codec.http.DiskFileUpload with 3.2.x

I came across this sample code for handling file uploads with Netty, this looks perfect, just what I needed. Unfortunately I am having difficulty incorporating this class as many Netty API features are unresolved. One of them for example is io.netty.handler.codec.http.DiskFileUpload, I am unable to find this in any of the online API docs for 3.0,3.1.3.2.
The class I am having issues with is here:
https://github.com/netty/netty/blob/master/example/src/main/java/io/netty/example/http/upload/HttpUploadServerHandler.java
I have tried using netty-3.2.5.final, 3.3.1.final, 3.4.0.Alpha
Unresolved imports:
import org.jboss.netty.handler.codec.http.HttpPostRequestDecoder.EndOfDataDecoderException;
import org.jboss.netty.handler.codec.http.HttpPostRequestDecoder.ErrorDataDecoderException;
import org.jboss.netty.handler.codec.http.HttpPostRequestDecoder.IncompatibleDataDecoderException;
import org.jboss.netty.handler.codec.http.HttpPostRequestDecoder.NotEnoughDataDecoderException;
import org.jboss.netty.handler.codec.http.InterfaceHttpData;
import org.jboss.netty.handler.codec.http.InterfaceHttpData.HttpDataType
import org.jboss.netty.handler.codec.http.HttpDataFactory;
import org.jboss.netty.handler.codec.http.DiskAttribute;
import org.jboss.netty.handler.codec.http.DiskFileUpload;
import org.jboss.netty.handler.codec.http.FileUpload;
import org.jboss.netty.handler.codec.http.DefaultHttpDataFactory;
import org.jboss.netty.handler.codec.http.Attribute
Any help appricated
When you see the org.jboss.netty namespace, that indicates v3.x
io.netty is used in v4.
Online documentation is located at http://netty.io/docs/
It's under master branch which is 4.0.0.Alpha1-SNAPSHOT from the pom.

Categories

Resources