My requirement is, I have a third party jar file and I am using Java 1.6 now. But due to version upgrade/migration the application needs to be moved to JAVA 1.8. I need a tool/utility/standalone program that will inspect my class/jar file and will give a summary/report which will tell whether there is any compliance issue.
For ex - Method deprecation. Thread.stop() is deprecated. The existing code will not run in higher version and will throw exception.
The best tool for doing this ist the java compiler. It can tell you what will not work anymore (errors) and which classes/methods are deprecated.
Related
I have been using ojdbc14.jar earlier and now want to upgrade it to ojdbc7.jar for supporting oracle12c.
But while connecting server gives error for "oracle/security/pki/OraclePKIProvider".
If I add oraclepki.jar to the classpath server starts up properly without any error.
I am trying to figure out what special got added in ojdbc7.jar that its asking me to add oraclepki.jar, As with ojdbc14.jar it never asked me to add oraclepki into my classpath.
Does anyone know what changes with ojdbc7 that's causing this error and what can be done to avoid adding oraclepki on classpath?
Check your classpath and make sure you remove the following: (if it exists)
-XX:-UseSplitVerifier
This is an issue recorded in the Oracle Support Database. If you have Oracle Support, you can find out more there. If not...
As Joseph Carroll states, removing the -XX:-UseSplitVerifier from your command line Java arguments might solve your problem. The UseSplitVerifier argument basically tells Java to use an earlier, less stringent, byte code verifier (which was sometimes used to get older byte code instrumentation tools to work when upgrading from Java 6 to Java 7). Unfortunately, it caused some problems when upgrading certain tools from Java 7 to Java 8. Other things you might do include (per Oracle):
Upgrade to a java 7 compatible bytecode instrumentation tool.
Or, as
a workaround, include oraclepki_121020.jar in the classpath. This is
a valid workaround in case upgrading to a java 7 compatible bytecode
instrumentation tool is not possible.
This article talks about why -XX:-UseSplitVerifier was added for using Java 7 with Oracle. This article talks about using the –noverify flag with Java 8 instead of -XX:-UseSplitVerifier.
Is there any version of JAVA, or an alternative to JAVA, which is compatible with dial-up. I keep getting the following exception even when using Google Chrome or FireFox.
ClassNotFoundException / org.apache.pivot.wtk.BrowserApplicationContext$HostApplet
I have the latest JAVA Version. Are there any older versions still available? JAVA.com does not seem to have it's own customer support centre
Everything else out there is either pay-by-the-minute or "buy our fix-it program"
Not all existing Java libraries are included in the JDK. You seem to have a piece of code which refers to a library called Apache Pivot. You need to make sure that you have the jar file(s) for this library and that they are in your CLASSPATH when you execute your program. I think you need to find a good book or tutorial.
Instead of including your library to the CLASSPATH environment variable you can also copy the external jar-files to your jdk and jre.
On my system thats for example:
C:\Program Files\Java\jdk1.7.0_21\jre\lib\ext\
and
C:\Program Files\Java\jre7\lib\ext\
I have better experiences with that, than setting the CLASSPATH.
I have a PowerMac and it is giving me bad version number on some .jars. I would love to make it seem like I am running Java 6. How would I spoof the version? Let me also say I am running PowerPC and Leopard
The most likely problem is that you have Java 6 JAR files and you are trying to run them on an old Java installation.
How would I spoof the version?
The answer to your question is that you can't. The way to run Java 6 specific JAR files it to use a Java 6 (or later) JRE or JDK.
The problem is that the format of Java class files has changed, and your installation can't cope with the new format. And this is not a gratuitous change that you can pretend doesn't exist. Java 6 (actually Java 5) has support for generic types, enums, annotations and other things. Assuming that the JARs contain code that uses these new language features, an older JRE simply won't know what to do with them.
There are two solutions:
Upgrade your Java installations to the required level on all machines. This is the best solution ... if it is an option ... because it means your users will get the benefit of security and bug fixes and performance enhancements. (And progress of your project won't be held back by the constraint of supporting legacy platforms.)
Compile all of your code for compatibility with the oldest version of Java that you still have to use. Either compile on the corresponding old JDK, or on a more recent JDK using appropriate -source / -target / -Xbootclasspath options ... as described by the javac manual page.
The catch with the second solution is that if the source code for the JAR files in question uses recently added Java language features or APIs, then recompiling for the older platform will fail. To fix this you will need to rewrite your code to replace the nice modern stuff with archaic stuff. Not a good solution, IMO.
The other possibility is that you are seeing corrupted JAR files. This is unlikely, but it can happen if you are using applets or webstart, and the server is delivering error pages instead of JAR files.
The third possibility is that you simply haven't configured your Mac's Java installation's correctly. Making Java 7 the default should allow you to run everything without class version problems. (Thanks #paulsm4) Note that I can't help you with that ... 'cos I don't use Java on a Mac.
I'm writing a program with Java7 and JavaFX2, but I'll need to show it to people who only have access to machines with Java 6 installed (with no JavaFX).
Is there any way I can find a solution to this short of asking them to install Java7 and JavaFX2?
Perhaps you can create a self-contained application package by "bundling" your program with Java 7 and JavaFX 2. That way you don't have to worry about what's on or not on your user's machine.
You can read more about self-contained application packaging at http://docs.oracle.com/javafx/2/deployment/self-contained-packaging.htm.
Theoretically yes, but you have to check if that is conform to the license conditions of Sun/Oracle the owner of JavaFX:
You could sue tools like http://one-jar.sourceforge.net/
They pack all your java into one jar.
Another possibility you could obfuscate your application and include JavaFX.
But this, too might violate the license conditions.
Both solutions might be more work, than the effort off installing JavaFX to the (one)clients computer.
Try JavaFX2 for JavaSE6
On page: http://www.oracle.com/technetwork/java/javafx/downloads/index.html
Download Download JavaFX 2.2.3 for Java SE 6 ...
If you are using Eclipse JDT, you can configure your projects "Java Compiler", by "Enable project specific settings", to "Compiler compliance level" value 1.6. This should produce bytecode in a version suitable for Java 1.6 VM. I suppose, but am not sure, that Eclipse shall also warn you if you use library elements not present in the 1.6 library version; though you can be careful about that with or without warnings. As with the previous solutions, JavaFX you can just package in your application's JAR if the license agreement allows it.
I'm trying to run an application with java 1.7.2 and its complaining it needs java 1.6 and up.
Is there a way to bypass that check(without recompiling, I don't have the source code)? both for casual use and so I can say that it seems to work in the bug report?
You need to decompile the bytecode to see how the code checks the java version. Maybe the bytecode tries to check a system attribute? In that case, you can reset the attribute to '1.6' before starting the proprietary code.
I can recommend DJ as a decompiling tool.
It is better to decompile the version checking code, to correct it and to recompile it. This will be hard if the code was obfuscated however.