Not able to find sun.awt.image.codec package - java

I searched a good lot but all in vain.
I want to get the source for sun.awt.image.codec.* java package.
Any help will be very appreciated..
Thanks
EDIT
Actually I have to use that package only, its required for my work. Its necessary for me since I am doing a performance eval [i can't change the code].

Update: This code is proprietary and the sources aren't available.
Try to use a decompiler or write black box performance tests.

Maybe you use OpenJDK? Install oracle jdk and try then.

Related

Analyze lib usage within a packet

I have a problem regarding the usage of libs in Eclipse. I want to know which lib is used in which package.
I tried the search functionality but this did not really solve my issue.
I do not try to figure out which libs are used in general but which are used e.g. in the test package only.
Thank you in advance!
A simple method is to temporarily remove the library and see where you get errors.

Cannot use com.sun.net.httpserver - Java 8

I am trying to create a simple server program to handle http requests. So with minimum search, I stumbled upon the oracle documentation for the httpserver class, inside the com.sun.net package. I'm relatively new to Java, so I thought that a class "sponsored" by Oracle itself would be included in the default libraries.
Unfortunately, that was not the case. After a lot of trials for possible syntax-import errors (various kinds of error arouse) and having installed the Oracle JDK 8 correctly on my Ubuntu machine, the compiler said that the package did not exist. What do I have to do to get the package to work?
I did finally make it work. Mostly, it was a misunderstanding from my place, since I only imported up to a point that was wrong - that is,I only imported com.sun.net.httpserver, thinking the latter part was the actual class I wanted, but it was merely the package name. So then I proceeded to import com.sun.net.httpserver.HttpServer, then the rest of my classes. Finally a com.sun.net.httpserver.* would work perfectly fine. It seems stupid now that I figured it out, but I think I will leave it here just in case anyone has the same misunderstanding - I already see 1 favourite on the question. And of course, as others have pointed out, the package is not part of the standard java libraries, but I used Oracle Java specifically for that.
P.S. The class is really useful, unlike what the other answer implies, but now I have stumbled upon another problem regarding reading the request body right, something that might have to do with the locale of the client-server, and I will now procced to search that.. Just a warning for anyone thinking of using the package.
Firstly try to avoid com.sun.xxx package, as those are internalls of Oracle/Sun java implementation.
Secondly, why not use libraries from apache ? See https://hc.apache.org/
EDITED:
You can also look on http://sparkjava.com/ , not tested but examples looks promising and they are using Java 8 nice features.

javax.realtime package is missing

I am very new to Realtime system development in Java. I create Java files in OpenSuse and compile it. I get an error:
The import javax.realtime cannot be resolved.
I have been searching for RealTime JAR file. I tried many website such as FindJar.com, Oracle website (Sun), etc. I cannot find it.
Any idea how to resolve this?
Realtime behavior is not something you can add to a VM by just adding a Jar file. The way priorities and synchronization are handled is completely different in a realtime JVM. You can download the personal edition of JamaicaVM to try out the RTSJ: "http://www.aicas.com/jamaica-pe.html". JamaicaVM does not just provide the javax.realtime package, but also provides realtime garbage collection.
Check out http://java.sun.com/javase/technologies/realtime/rts/ .
There is a evaluation download and academic license if that meets your demands
You could try: http://www.timesys.com/java/ (RTSJ Reference Implementation from timesys) . The copy's for Research Purpose though.
I have found out that the Javolution-Core package contains javax.realtime.RealtimeThread class https://mvnrepository.com/artifact/org.javolution/javolution-core-java/6.0.0.
However, the essential dependencies like javax.realtime.SchedulingParameters and javax.realtime.ReleaseParameters are still missing from this package.
I think you can download a RT implementation from IBM for Java 8 here.
Also, if you want more find more information check this answer.

Is there any program like LINQPad for Java?

I've found LINQPad to be extremely useful when answering StackOverflow questions for C# or VB.NET. It allows me to write up some quick code, run it, and (if I want) see a nicely-formatted dump of the results. That way I can be sure that the code I post actually runs. Thus far I haven't seen anything that I can use to achieve the same result with Java. Is there anything like that out there?
I am not looking for something to query data sources; I just want a light-weight IDE. These are the features I'm particularly interested in:
The ability to write and run short snippets of code without establishing a whole project or file structure.
Reporting of compiler and runtime errors in the code when it is run.
The ability to add references to a particular editor instance.
Syntax highlighting and Autocomplete/Intellisense would be a plus.
JPad - A java scratchpad for running snippets
Since I also couldn't find one I've decided to write one. Currently it can:
Run java snippets (no class / imports / public blah... needed).
Contains drivers for MS/MySQL/Postgres.
Output results as HTML tables
It's very rough but I will add to it over time. Feedback is definitely welcome.
This may help : http://www.browxy.com:9000/codeRunner
EDIT: Url seems to have changed to http://www.browxy.com
You can use the Groovy web console ; it's possible to speak java in groovy land.
Java Snippet Runner:
Does something similar to Linqpad (jar file, not just for macs)
http://mac.softpedia.com/get/Development/Java/Java-Snippet-Runner.shtml
Code Runner (Commercial):
for Mac's only, it'll run code snippets in Java, and lots of other languages too (e.g. Objective C)
http://krillapps.com/coderunner/
http://ideone.com is an online service that has the features you want.
I've been using JEdit for a long time, which is a very powerful cross-platform editor, NOT an IDE. It does have plugins to execute Java code right in the editor, and even uses BSH for macros.
I was looking for a "Java LinqPad" also, and i came across :
this
I've been using IntelliJ IDEA and it works really well as a Groovy scratchpad. The Community Edition is free too.
You need to create a new project, but then can add Groovy scripts to it and run them on the fly. Not had any luck with the actual Scratch File functionality though.
Being a Jetbrains editor it's pretty slick too. (Unlike some of the other options)
Nothing beats LinqPad though.

overview/understand architecture codes in eclipse

I have a maven project imported into Eclipse. I'm trying to understand the code pattern (architecture). What is the best way to do this?
will use any UML Eclipse plugin help on this?
will use sequence diagram, help on this?
what plugins should I use?
Please share your opinion.
When I am working with a open source project/codebase I get a high-level view and focus on the core code/logic by checking the package names and structure. I then typically determine how the API works by looking at any example code / documentation contained in the project. If I still need some more help I will draw up some inheritance diagrams, print out interesting classes that I may need to make significant changes to, and try to find more examples of the code being used elsewhere.
I am biased and have been using our recently launched Architexa Eclipse plugin to accomplish the above. I am sure there are others available that do something similar.
I guess you will find some pointers in this SE-Radio podcast: Episode 148: Software Archaeology with Dave Thomas.
Of course, UML can help, but on the other side, it might not as well. For reverse engineering, there is the MoDisco project in Eclipse, which might be useful.

Categories