Jaxb system path - jaxb

I just installed java Web Service Developer Pack 2.0 to use JAXB for xml operations. The tutorial says me add "C:\Sun\jwsdp-2.0\jaxb\bin" to the system path.I select Computer->Properties->Advanced System Settings. I come to the Advanced tab I open the window Environment variables. and i selected PATH from user variables,selected edit and append "C:\Sun\jwsdp-2.0\jaxb\bin" to here. But when i write xjc,it is still not recognized. What should i do more ?

I just checked the release notes for JWSDP 2.0, and they're copy right 2005.
http://java.sun.com/webservices/docs/2.0/ReleaseNotes.html
If you're just looking to run XJC it is also included as part of Java SE 6. You can run it as:
C:\Program Files\Java\jdk1.6.0_20\bin\xjc
As for JAXB implementations you can choose from:
EclipseLink JAXB (MOXY)
Metro JAXB (the reference implementation, included in JAVA SE 6.

Related

Xpages can't load, Error 500; java.util cannot be resolved

I recently moved a couple of applications to a server that is running Domino 9.0.1FP8 (JVM version: JRE 1.8.0 Windows Server 2008 R2 amd64-64). Since I did this I've been unable to load any, but the most basic of Xpages. I get the "Error 500 HTTP Web Server: Command Not Handled Exception" page.
Via the ...IBM\Domino\data\IBM_TECHNICAL_SUPPORT\xpages_exec I get Exceptions such as:
The type java.util.Comparator cannot be resolved. It is indirectly referenced from required .class files
The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files
The import java.util.Arrays cannot be resolved
I'm also getting the following Errors in the "Problems" tab in Designer:
"The project was not built since its build path is incomplete. Cannot
find the class file for java.util.Comparator. Fix the build path then
try building this project"
"The type java.util.Comparator cannot be resolved. It is indirectly
referenced from required .class files"
Is there a reason the java.util is failing in Java 1.8? Is there anything I can do? Thanks for any help.
Dan
This problem occurs when Domino Designer 9.0.1 FP8 attempts to compile against a Java8 JRE. The version of eclipse in that Designer install does not know how to parse some of the runtime jar files in Java8. The workaround is to compile against a Java6 JRE instead. There were changes in the Domino Designer installation as part of SPR#BGLN9PXEVM to change the configuration of the preferences in Designer to point to a Java6 JRE instead of using the default JRE. If there was some install problem or you manually modified your preferences, you may need to manually re-apply the workaround as follows.
In Domino Designer, menu File, Preferences, Java, Installed JREs.
There should be 2 listed JVMs with paths like so:
[x] jvm C:\Notes\jvm1.6\
[ ] Notes 8.5.1 VM (locked) C:\Notes\jvm
If your entry named "jvm" is incorrectly pointing to the C:\Notes\jvm\ folder instead of the jvm1.6 folder, then you will need to edit it to point to the jvm1.6 folder instead.
On the Domino Designer team we are investigating potentially upgrading the eclipse version in Designer, so that it might be possible to compile against a Java8 JRE.
It sounds like the installer has not installed successfully. There's no reason java.util packages should be failing. I would recommend running the installer again, making sure all services are stopped prior to running it. That will ensure that anything that needs replacing isn't locked by another process.

Netbeans cannot find the CDI package javax.enterprise.context.*

I am creating a simple JSF application with one of my university colleagues, and I am having some trouble when I pull down the application from our repository. When I import the project into NetBeans IDE 8.0.1, the program does not compile correctly on the following CDI based annotation:
#Named
#RequestScoped
public class LoginController implements Serializable {...
It is informing me that it cannot find the following package:
import javax.enterprise.context.*;
Initially I had thought that I did not have the EJB and EAR plugin installed, however I have installed the Java EE bundle which I downloaded from the netbeans website. Are there any other JAR's, which I may be possibly missing, causing this specific error.
On my colleagues local machine everything works as expected without any issues at all, so I am left unclear why this is not happening on my computer.
yeah it seem this netbeans version lacking javax.enterprise package. Here is the solution
1) If you are using maven project, add javax.enterprise(cdi-api.jar) as dependency
2) For other projects, download cdi-api.jar, add this as external jar from project properties, it will enable CDI.
Yes you need to include another library. You are using the part that belongs to Java EE. By default java includes Java SE. So you need to add this library in your project.
Go to
Project Properties -> Libraries -> Add Library -> Java EE Web 7 Api Library
I had this problem too. The glassfish library structure has changed somewhat so instead of using the "Java EE from Glassfish" library we used the "Java EE from API" library and that fixed it.
Both proposed solutions are valid but the simplest one is the second one because you've got already everything needed in NetBeans 8.0.
Your problem is clearly the consequence of the default Java EE bundle (version 7) present in GlassFish 4.1. Of course, it is a NetBeans bug. Netbeans should have added the needed library to your project when you chose to work with Java EE 6.

MyEclipse's class file

I'm using MyEclipse and want to change to Eclipse directly, but I found that the .class file generated by MyEclipse and Eclipse are different. First, I found the JDK version are different (I reference http://en.wikipedia.org/wiki/Java_class_file to find offset 6-7). But after use same JDK the .class are still different.
I also use Java de-compiler for the 2 .class files, but get the same result, is there any suggestion for me? Because it's an old system, if the class files are different, I have no confidence to do migration.
The Java functionality in MyEclipse is the same as eclipse, at the relevant version. MyEclipse 2013 is based on eclipse 3.8.2 (though eclipse 3.8.2 is a bit more difficult to find than 4.2.2), MyEclipse 10 is based on eclipse 3.7.2. Eclipse will be using the Java compiler in the JRE specified for the project (which may be different from the default specified for the workspace). You should also check the Java compliance level for the project (or the workspace default, if there is no project specific level specified).

how to display embedded manifest

I have some projects built with different versions of VS2005 that require different run-time version. i need to display the assemblyIdentity to see which run-time is required to run the program. I need the information to include the specific VC80 runtime MSM in my WiX installer project.
{Edit}
While the binaries have been built with Visual Studio I don't have a VS on the PCs where WiX shall be used. I am reluctant to install an Express version, since I am a guest on that PC.
{/Edit}
How can I conviniently display the embedded manifest? Preferrable with a small tool, command line tool would be OK.
Manifests are stored as resource in executables/DLLs. These are stored under RT_MANIFESTresource type. Open the resources under it and parse it as XML.
One example is pasted below (I opened one of my EXE using VS resource editor):
The PeStudio is a small tool that does the job. Including displaying the manifest in clear text.
Additionally it displays all DLLs that must be present on target system. That helps to author the installer.

Can a groovy code be compiled to run in JRE?

I am new to groovy and I cannot understand, if it is possible to compile a groovy program, so it runs at all computers, were the JRE is installed.
The application I am developing has to run on any computer with JRE 1.5. Is it possible to start using groovy and maintain this flexibility? With JRE 1.6?
I have heard about the library groovy-all-VERSION.jar. Is this the one required library to be shipped with my application?
The answer is yes. In fact, all groovy code compiles down to Java classes that run on the JRE. All you need is JRE 1.4 or higher and the groovy-all-*.jar on the classpath of your application.
Since you are looking to support JRE 1.5 or higher, make sure your source compatibility is set on your compiler to this level.
There are a few options for compiling your groovy code. Groovyc (Ant Task), GMaven (Maven) and Gradle are all options.
Another option you have is to 'not' compile your groovy code. The groovy distribution only requires the JRE to be installed. You can ship your application as a set of scripts that can simply be run using the groovy install. It depends on how sensitive your source code is.
The short answer is yes. How you do this depends on your build system. I do all my development in eclipse, right click my project, select export, select runnable jar file, and all the required librarys are exported in the jar file. I can then run this file on a machine with out Groovy installed. I know build systems like Maven support Groovy but don't know the details on how they do it or how good there support is. According to this question Java 1.4 or above is fine. When looking at the "Setting up your Java environment" section of the initial tutorial it looks like you need Java 1.5 installed.

Resources