Why isn't the javax.smartcardio package in the Java SE 7/8 API? [duplicate] - api

I'm studying the javax.smartcardio classes. I'm using eclipse 3.6 and I have JDK 6 SE. I can use the statement import javax.smartcardio.* or any of its individual classes, as long as I change preferences to warn or ignore forbidden references.
I don't see any mention of javax.smartcardio in the standard documentation at Java SE 6
and no javadoc help pops up in eclipse. I have found docs here.
Is there a way of linking Eclipse to the javadocs for smartcardio?

I found a WebLog about it (Konstantin Flitschew WebLog (german)). It's in german but it worked for me, so I give a short translation here:
create a java project or open an existing project
right-click the project and open the properties dialog
select build path -> libraries tab and unfold the "JRE System Library" tree
select the entry "Access Rules" and push the "edit" button on the right
you can apply a rule with the "add" button: set the drop down to "accessible" and enter the value “javax/smartcardio/**”
With this setting I was able to access the classes of javax.smartcardio.

I've asked Sun back in the day multiple times to include the javax.smartcardio in the documentation, but they have refused all the times. Now it seems that 64 bit Java version 6/7 for Windows do not have javax.smartcardio, and that the access rules rule out using it directly. This is pretty strange as javax.smartcardio seems to be an accepted JSR.
Sun and Oracle don't really communicate well regarding security API's. They are relatively well designed, but the support is lacking, and they do introduce features out of the blue.
[EDIT]
Although the javax.smartcardio package is an accepted JSR, the umbrella JSR's for Java 6 and 7 SE don't include it. See java_se-fr-spec.zip for more information (see below). So javacardx.smartcardio it is not part of the Java SE standard API. Nowadays you may have trouble accessing the API even if it is present. And you cannot add your own as it may be present for a particular edition. You can use Eclipse access rules to enable javax.smartcardio and remove access violations from your "Problem view".
Java 8 from Oracle does include an javax.smartcardio implementation. You may still have to configure access to it.
JSR 268, the Java Smart-Card I/O API, will not be included because the
JSR 270 Expert Group concluded that it would not be of sufficiently
wide interest in the Java SE 6 time frame.

Oracle's JDK does not contain the javadoc for javax.smartcardio at all. Use OpenJDK instead.
Install OpenJDK from https://adoptopenjdk.net/, then add it in Eclipse using Window -> Preferences -> Java -> Installed JREs (in Windows the path you need looks like C:\Program Files\AdoptOpenJDK\jdk-8.0.242.08-hotspot). The result:

I was in the same situation as you were but then I found this http://intelligenzija.net/?q=node/1
Basically you need to set Access rules for these classes in the IDE so you can use them.

Related

Mule4 with Open JRE 11 - Adding additional file module-info.java?

I have downloaded fresh Mulesoft studio and changed configuration to point Open JRE- 11 and compiler to point 11.
Studio version - 7.8
When I try creating the mule project it is now also adding module-info.java along with mule.xml files.
Wonder why it is creating module-info.java I don't used to see when i was working with 1.8 version or before.
Any Idea ?? Thanks in advance.
Java 9 introduced a whole new level of encapsulation. Larger than packages, and more robust too. These are modules.
Chances are you should in the long term, migrate your project to use modules (for additional security, and for better code organization). However, the chances are also high that you won't want to do it right now, just because.
In that latter case, it would be reasonable to simply delete the module-info.java file. Provided you don't have any other module-info.java files in the system, and provided you run with everything on the classpath rather than module path (there's a good chance that's your default anyway) you should not have any problem.
Meanwhile, you have some homework to do, so you can decide if you will migrate to modules, and if so, how to do it.

Mule - Updating third party library in runtime

I'm using Mule Server 3.8 EE which brings commons-lang 2.4 with it. A third-party library in my project needs commons-lang 2.6, because it uses a method that was introduced in this version.
So when I just start my application, I get a java.lang.NoSuchMethodError
Is there a way to update the dependency in the runtime? What I tried so far:
including commons-lang 2.6 in my app -> no effect, the one from the runtime is picked up first
replacing the jar directly in the runtime -> errors in studio, that the 2.4 jar is missing
so maybe i am late BUT -- this is your answer. Add the libraries that are newer in the jar distribution to the Build Path. Under Java Build Path screen you should see the libraries listed. I needed to use Apache http-client 4.5.6 and that's very interesting because it brings with it a lot of other dependencies, so your question was VERY relevant. The solution is to rely on JAVA (and not mule -- oops Anypoint or whatever) conventions and make sure the JVM loads my class files first. Then, it won't load the old ones from mule's jar. And so I went to the tab Order and Export, and moved Mule to the bottom. This simple, trivial change makes it work. I think if we would work with command line and vim, we would all know this. But all the IDE gui and everything else makes us forget the simplest things. Please use it in good health. :)

Where has the JavaFX scene builder gone?

I am trying to find the elusive JavaFX scene builder so I can use it in Intellij. I am on Windows OS.
Oracle have stated that the JavaFX scene builder is included in a new download, but no matter how I search I cannot find it (see http://www.oracle.com/technetwork/java/javafx/downloads/index.html). I think they have linked to the incorrect page and Googling for it is getting me nowhere.
I already have Java 8 SDK installed and working fine. Apparently JavaFX is now included in that, but nowhere in the Java folder can I find the scene builder and it seems to be completely missing online.
Please can anyone help? I am just wanting to write a small GUI program and it seems like JavaFX is the way to go (if it isn't then feel free to disabuse me of this notion!)
With JDK8u40, according to this:
Starting with Oracle Java SE 8u40, Oracle does not provide a separate set of accompanying JavaFX Scene Builder binaries. If you would like to contribute changes, ideas or just let us know what you have done with the code, please consult the OpenJDK Community contribution guidelines and join the openjfx-dev mailing list.
You can still download the last binary at Oracle in this link. But check this warning:
WARNING: These versions of JavaFX Scene Builder may include components that do not contain the latest security patches and are not recommended for use in production.
This means it doesn't include the last changes of 8u40, like the new Spinner control.
Alternatives
The project is open source, and you can find the updated code at the OpenJFX repo. So you are free to download it and build it.
Since its released under BSD license, Gluon is offering support for an updated version of Scene Builder, and you can download an installer for your platform or an executable jar from here.
Besides, they have an open repository where anybody can contribute.
Install JavaFx Scene Builder (Gluon) with Intellij 14 on Windows with JDK7
This will probably work with Java 8 as well but I am using 7 so I didn't test 8.
I know this has been answered but this might be helpful for future Intellij users. To get scene builder to work with Intellij 14 use the following steps.
Install Scene Builder for Windows. Download/Install From Here (Windows Installer (x64))
Set Scene Builder path to executable in Intellij. File -> Settings
-> Languages And Frameworks -> JavaFx By default mine installed under C:\Users\kris\AppData\Local\SceneBuilder\
Open your .fxml file. Click on the scene builder tab.
UPDATE 2019:
The default install path appears to know be "Program Files" C:\Program Files\SceneBuilder\SceneBuilder.exe
JavaFX plugin might need to be enabled in Intellij 2019
On a mac, in Intellij, you need to go to preferences, then type JavaFX and then do this. Please look at the attached Image.

org.eclipse.search.internal.ui.searchpreferencepage.java is not available on eclipse 3.7.2

I could not find org.eclipse.search.internal.ui.searchpreferencepage.java in eclipse 3.7.2 version.It was available on eclipse 3.2.2. Can any one help me on finding that why this class has been removed from latest version and is there any alternative for this class on new version.
Is there any limit related methods on eclipse 3.7.2 plugins?
This is an internal class and consequently is not part of the Eclipse API and is subject to change without notice (see Eclipse API Rules of Engagement).
However it is still present in Eclipse 4.3 but is marked x-internal:=true in the Export-Package in the MANIFEST.MF. It is also present in Eclipse 3.8, in both cases in the org.eclipse.search plug-in.
The table limits which used to be in the preference page were removed some time ago, probably when the option to show the results in a tree was added.
Edit:
Further research shows the limit was moved from the preferences page to the Search Filters dialog in the drop down menu of the search view. The limit configured here can be accessed using the getElementLimit() method of org.eclipse.search.ui.text.AbstractTextSearchViewPage
getElementLimit() returns null if there is no limit.

Eclipse 3.7 RCP Application with multiple plugins

What is the right way to make an RCP application that is “ready for plugins”? I have struggled to do this basic concept and am trying to accomplish this in Eclipse 3.7 (latest 3.x version).
Step 1
I would like to explore this by using 3 eclipse plugin projects:
• HelloWorldRCP
• HelloWorldPluginA
• HelloWorldPluginB
Would it make sense to make HelloWorldRCP with all the common things such as a menu-bar with an Edit menu including cut, copy and paste menu items? The HelloWorldPluginA could add an additional menu-item called “Alpha” and HelloWorldPluginB could add yet another menu-item called “Beta”? However, the cut, copy and paste functionality could still work within Plugin A and B?
Step 2
Next, how do I deploy this as a “product”? I have made a new product configuration and defined the dependencies from the default runtime configuration that was made. I do notice that there are a lot of dependency jars that are included, but I don’t think I use them. For example, I don’t use data-binding to my knowledge, but it keeps coming up as a required dependency.
I go to Export | Eclipse Product and an executable environment is created in my desired folder. However, when I copy this to another machine it seems to keep referencing the original machines Java installation location. How does one get around this?
I have tried to bundle a jre with the Product Export but nothing is created. I have also just tried copying my jre6 as a jre folder. This does seem to work.
Next problem here is the 32/64 bit Java execution environments. What is advised here? I have been aiming to build on 32 bit only and then hopefully that will run on 32 or 64bit platforms. Is this correct?
Step 3
I need to web-start this now. The old way of initiating an Eclipse 3.5 application, using a startup.jar has changed. I now use the equinox launcher and reference it in the jnlp instead of the startup.jar. However, I keep getting an exception which seems related to the 32/64 bit equinox win32_64 jar. I notice that the export writes a folder and not a jar. I read somewhere that this is a “clever trick” to allow compatibility for both 32 and 64bit runtime environments.
The problem here is that I need a jar and not a folder so that I can sign the jars required and deploy accordingly.
Does anyone have a Java Web-start example for and Eclipse 3.7 RCP application? Or any advice?
You are going to need a lot of time to learn everything you've asked about here.
Here is one of the best places to start... http://www.vogella.com/eclipse.html
That site covers a lot of basics. But you need a little more than basics.
The best example of a working RCP product with some of the features you require can be found at ... http://max-server.myftp.org/trac/mp3m
This guy (Kai) makes all of the source code available via SVN, and he has some very advanced stuff going on in his application. He also has a good blog with some advanced RCP tips and tricks. http://www.toedter.com/blog/
Another thing you'll want to investigate is Tycho. I realize that you didn't mention anything about building your application, but I've found that using Tycho for building has made my most recent foray into Eclipse RCP 100 times better than the other times I've done RCP work. So, my advice, get to know Tycho. http://wiki.eclipse.org/Tycho/Reference_Card
The learning curve of Eclipse RCP is somewhat steep, but I think it's worth the effort.
Good Luck!