Compiling against Java 7 in JDeveloper 10 - java

Is it possible to use Java 7 in JDeveloper 10?
I have an application that works correctly in Java 5. I've updated the java.conf file to point to the Java 7 jdk, and I've changed the project properties to use the same Java 7 J2SE. When I try to compile, however, I get many errors similar to those below:
Error: class format error: Object.class on classpath C:\Program Files (x86)\Java\jdk1.7.0_40\jre\lib\rt.jar/java/lang/Object.class
Error: Object not found
Error: class format error: Class.class on classpath C:\Program Files (x86)\Java\jdk1.7.0_40\jre\lib\rt.jar/java/lang/Class.class
Error: Class not found
Error: class format error: String.class on classpath C:\Program Files (x86)\Java\jdk1.7.0_40\jre\lib\rt.jar/java/lang/String.class
Error: String not found
It seems to be choking on the java definitions themselves. I'm hoping I'm just missing a step somewhere.
Also, upgrading to a later version of JDeveloper is not an option. JDeveloper 12, as far as I've been able to tell, will not deploy to an OC4J instance.

No, you can not use jdk 1.7 together with jdev 10g. You have to stay with Java 5.
And yes, you can't upgrade to 11g or 12c as they don't use oc4j but Web logic Server.

one more notice from me. jdeveloper 10 does not run itself (this means jdeveloper 10g software does not start) with java 64 bit. also not with java6. However, if you successfully started jdeveloper with java 32 bit, you can use java 6 (jdk6) to compile and run your java applications. This can be done by changing the property of your project. Just add there a new java machine 64 bit (under libraries) and let the project us it.

Related

Java JDK 11 - JRE not recognized by external application

I understand that the Oracle Java Development Kit 11 (JDK) does no longer include a public JRE (Java Runtime Environment). However the documentation says it includes a private one (I actually don't understand what that means).
I installed the JDK 11 on Windows 10 64x according to the documentation and set the path system variable accordingly. When I type
java -version
at the command line I get informed that there is indeed a runtime environment in place.
However, when I now try to install e.g. a Plugin (Zotero) for LibreOffice that needs a JRE, it is NOT recognized ...
Why does this happen? Do I really need to install the separate JRE from Oracle to get it work?
I read the manual and the migration guide - sorry if this is a stupid question, but I'm stuck.
Thank you!
Andi

how publish java webapp on vps server, i tried by it doesn't work

I want deploy java webapp on vps server with ubuntu. I installed jdk, jre and tomcat, but when i try to see tomcat standard welcome page it returns error: org.apache.jasper.JasperException: Unable to compile class for JSP. Here is the link to my server: http://something.nazwa.pl:8080.
How can i repair this error and how properly prepare vps to java application?
I had never been using Linux,so it is difficult to me.
Ok. Try to set the JDK 8 of oracle or OpenJDK 8. Becasue from the Site of Apache Tomcat
Building Apache Tomcat requires a JDK (version 8) to be installed. You
can download one from
And you jave OpenJDK 9
And remember
IMPORTANT: Set an environment variable JAVA_HOME to the pathname of
the directory into which you installed the JDK release.
--- Edit ---
Ok going more deeper I found that tomcat 9 can run in Open JDK 9, but it might contains bugs
For example, users were successfully running Tomcat 8 on Java 8 many
months before the first stable Java 8 release. However, users of early
access builds should be aware of the following:
It is not unusual for the initial early access builds to contain bugs
that can cause problems for web applications running on Tomcat. If the
new Java version introduces new language features then the default JSP
compiler may not support them immediately. Switching the JSP compiler
to javac may enable these new language features to be used in JSPs. If
you do discover an problem using a Java early access build, please ask
for help. The Tomcat user's mailing list is probably the best place to
start.
From Apache Tomcat.
Conclusion
Try to go with JDK 8 of oracle and set your enviorement variable

Does Japser Reports work with Java9

Im having trouble using Japser Reports with Java 9.
My JasperVersions:
<dependency.version.jasper>6.5.1</dependency.version.jasper>
When trying to build my Report i get the following error Message:
An internal error occurred during: "Building report".
java.lang.UnsupportedClassVersionError: my/path/to/my/class/User has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
the Error occurrs probbably because Jasper does not Support java 9 Classes. I cant find any information on this topic, does anyone have a Idea how to write a workaround or did i do some other mistake?
EDIT:
After searching some more i realised that the problem only happens when im in the Designer in Eclipse, so it is most likely that eclipse itselve is not running in a JVM 9. I checked for the current version of java installed and it is java9, when i change the eclipse.ini file from:
-Dosgi.requiredJavaVersion=1.8
to
-Dosgi.requiredJavaVersion=1.9
i get a incompatible jvm error which says that im trying to start it with 1.8.0_161. How do i change my settings that my eclipse is acutally using my current JDK?
RESOLVED:
The error was that my Eclipse itselve only run in Java8. So my Application was building everything in Java9, like i wanted it to, but when i was inside the jasperReports Designer, the designer itselve run in java8. Thats why it crashed. The solution was to change the systemvariables and put my JavaPath over the Oracle JavaPath that for some reason had a higher priority.
Code was compiled in Java version 9 but executed in Java 8 JVM, which not necessarily works. Try compiling it in Java 8, or executing it in Java 9 JVM.

Liberty server with java 1.8

Getting below error while deploying application in liberty server.
It seems drools compatibility issues with java 1.8.I cannot change my drools / mvel jar version since it requires significant change in drools. In one of the forum , i have read to use updated ecj version jar So I have updated ecj jar to 4.5.1 version but even though getting the error .This solution works in tomcat and WAS Server without any issues with java 1.8 migration
Caused by: java.lang.VerifyError: (class: ASMAccessorImpl_7258891721511957152780, method: getKnownEgressType signature: ()Ljava/lang/Class;) Illegal type in constant pool.
Can anyone please let us know what need to do for solving the above error
Normally I've seen this problem occur when using .class files compiled with one JDK and running with another (e.g. compiled w/ IBM JDK 7 and running with Oracle JDK 8).
To work around the VerifyError you can add -noverify to your JVM_ARGS (via jvm.options).
For more detailed analysis it would be helpful to know:
the complete stack trace of the error
what JDK you are running with
the version of WAS Liberty you are using

How to set the correct path for JRE and JDK while building through jenkins in CentOS 7?

I am facing an issue with the jenkins build in one of our servers.
Issue is :
[ERROR] PATH_TO_FILE/EventsServiceImpl.java:[1592,137] method references are not supported in -source 1.5
EventsServiceImpl.java:[1592,137] contains the following code.
List<String> androidDevicesList = deviceIds.getDeviceIds().stream().map(Object::toString)
.collect(Collectors.toList());
By the looks of the issue, it is saying that the jenkins build is taking 1.5 to build the code. where the above code needs java 8 to compile. I have done everything to set the path correctly. I have checked the $JAVA_HOME path in the server. And it points to the correct JRE version. i.e. 1.8.0_111
I also checked my Jenkins JDK path and it is correct as far as I knew.
It is working fine in my local system. My Eclipse compiles it without any issue. But if I change the java compiler from 1.8 to 1.7 / 1.5, it is throwing the error.
My System Config:
OS: Windows 7
JDK: 8
JRE: 1.8.0_31
Server Configurations:
OS: Cent OS 7
JDK: 8
JRE: 1.8.0_111
I don't know, exactly what is the issue? Is it the issue with Jenkins? or is it the issue with Java compiler path in the server? Or is it the issue with Mavan in the server.
And also I have ran sample java file in the server with the above code in it. I ran without any issue. I am able to compile the code and build the code and saw the output.
The "-source 1.5" indicates that the java compiler, even though JDK 8, is being told to compile the code at JDK 5 level. It's not possible to tell definitively where this is coming from given the information posted. Please post your pom.xml file or check it (see this for more info) for a
<source>
tag. Also check the Build section of your Jenkins project configuration to make sure it isn't being set as a command line option there.

Categories