Eclipse javax.websocket import not resolved - java

I'm new to Java development (using it for speeding up my real-time game server, coming from Python).
I'm trying to add some basic Java server-side websockets, and added the simplest example code I found (from WebSockets production ready server in Java?).
I'm importing the following:
My problem is, eclipse is telling me that the import "javax.websocket" cannot be resolved. Where I can add the "javax" module? I don't understand the complicated interface fully yet, thanks a lot for any help! (I've got the latest eclipse, with Java 8 installed on Mac os X 10.11 latest)

Do you use JDK or Java EE? javax.websocket is in Java EE.

Related

Which Java EE server?

I'm moving in to developing Web Apps using Java EE and the first problem I have is not knowing which Server to use! There seems to be so many to chose from!
Glassfish server seems to stand out foremost (and it's top of the list) but when I try to start Glassfish 4.1.2, I get the error GlassFish requires Java SE version 6. and I can't download Java SE 6 for MacOSX without joining the "Oracle Club".
So which Server should I use??
You're running JDK 8, as you should. You should not be downloading JDK 6. It's long past the end of its support life.
Looks like the latest is version 5. You can download it here.
It should be said that you don't need Java EE to write Java web apps. Another alternative is Spring Boot. You won't need an app server, just an executable JAR to be run on a JDK.
Are you on OSX? You can get a JDK1.6 download here: https://support.apple.com/kb/DL1572?locale=en_US
I would be very careful with JDK1.6, it's about as safe as seatbelts made from toilet paper.

Error while importing the Java-1.7 project libraries into Android

I've asked a lot of questions the last days, because I couldn't include a .jar-File in my android-project (working with ant).
Today, I switched the Java-Version of this Common-Project to 1.6 and created a new .jar-File.
And noooow, it works!!
Can someone tell me, why Android (2.2) doesn't support Java 1.7?
Thank you!
Because when Android 2.2 was created, there was no Java 1.7.
Compare http://en.wikipedia.org/wiki/Android_version_history against http://en.wikipedia.org/wiki/Java_version_history
In addition to the timeline issue, there is also the issue that Android is not based on the Oracle Java codebase, and hence supporting Java 7 on Android is not simply a matter of porting existing code.
Does Android plan to support Java7?
Java 7 language features with Android
Indeed Java 7 adds a new bytecode, so that would entail a change to the Davlik VM to support it.

Is there any way to develop a Java 1.5 application using Cucumber-JVM?

Cucumber-JVM has dependencies on Java 1.6
My client's application runs on Java 1.5 and this can't be changed at the moment
Does anyone know a way to use Cucumber-JVM to exercise my client's application?
I also posted this question on the Cukes mailing list (https://groups.google.com/forum/#!topic/cukes) where I got a response from Aslak Hellesøy (CUcumber's creator):
Me:
Is there any reasonable way to use Cucumber-JVM, built under Java 1.6, to develop a Java application that must run on JRE 1.5?
Aslak Hellesøy:
Short answer: No.
Long answer: Try it and share the problems you experience, then we can talk about whether it's possible to work around them.

Java EE SDK for mac

After spending 3 solid days on this with nothing to be happy about. I'm being freaked out already. I'm a newly in java and just about getting it rolling in java ee...
Please, good people here. I am confused. I am looking for Java EE 6 SDK for mac os x lion 10.7.2 64bits.
I found on oracle's website java ee 6 sdk for unix and windows and no mac... spent tons of time on google and apple's website forums and support but found nothing pertaining to this.
Is it that mac does not need Java EE 6 SDK? or what? I already have netbeans installed and eclipse as well which I've been using during my early beginning stage in java SE.
Can anyone help?
Thanks in advance!
Mac is the Unix, did you tried shell script they provided?
Java EE is an API, not a complete implementation ( that is provided by your application server where your code is deployed to).
Hence you just need the API jars. This can, however, be avoided if you get the Netbeans+Glassfish bundle, and let Netbeans do the work by choosing an appropriate template when creating a new module.

Using JSR82 in Java Application

I am trying to write a Java application showcasing Bluetooth features. On general search, I found JSR82 has been defined for the same.
I am not able to figure out exactly how to use it. I am using standard java 1.6 and I believe for JSR82 implementation I would need J2ME running.
I need help to understand how to use the 2 java editions together. I have never worked with the Micro Edition before. Would appreciate any inputs.
Thanks & Regards,
Keya
You can simple try using a JSR82 implementation on your mobile device - it should work.
This site has some good information about it.
Here are two JSR82 implementations I know of:
Bluecove
Avetana
Go to http://java.sun.com.
Install the jdk and the latest full version of Netbeans for your linux computer.
Use Netbeans to create a HelloWorld mobile application
Run it in the Wireless ToolKit emulator packaged into Netbeans.
That should work right out of the box.
You then need to read the JSR-118 specification to understand how a MIDlet works.
Then read the emulator documentation to figure out how to provide bluetooth data to your MIDlet.

Categories