Pyspark & Jupyter: Unsupported major.minor version 52.0 - pyspark

I downgraded from JDK 1.8 to 1.7 as I'm trying to deal with another problem for which one suggestion was to use 1.7.
However I'm now finding that my Juypyter notebook now hangs on this line:
spark = SparkSession.builder.appName("Basic").master("local[*]").config("spark.network.timeout","50s").config("spark.executor.heartbeatInterval", "50s").getOrCreate();
Looking at the console I see:
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/spark/launcher/Main : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Which from searching I understand is due to different versions of Java being used. However both my path and Java_Home are pointing to 1.7 not 1.8 and I rebooted my machine. What else should I do? Should I remove and re-do my pip install of pyspark?

Just use a Docker container from: https://github.com/jupyter/docker-stacks
Why make it difficult for yourself?

Related

Unable to run junits in eclipse for jhipster sample app gradle

I checked out https://github.com/jhipster/jhipster-sample-app-gradle imported the project into eclipse Version: 2020-03 (4.15.0), installed gradle plugin. When I try to run the Junit test Right click -> Run as Junit I keep getting
java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: org/junit/platform/engine/EngineDiscoveryListener
at org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder.getLauncherDiscoveryListener(LauncherDiscoveryRequestBuilder.java:241)
at org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder.build(LauncherDiscoveryRequestBuilder.java:235)
at org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader.createUnfilteredTest(JUnit5TestLoader.java:75)
at org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader.createTest(JUnit5TestLoader.java:66)
at org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader.loadTests(JUnit5TestLoader.java:53)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:526)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:770)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:464)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)
Caused by: java.lang.NoClassDefFoundError: org/junit/platform/engine/EngineDiscoveryListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 9 more
Caused by: java.lang.ClassNotFoundException: org.junit.platform.engine.EngineDiscoveryListener
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 21 more
I tried searching all over but couldn't find a solution that works, Anybody had the same issue and got it resoled please provide the solution
enthusiast,
Just add
testImplementation('org.junit.platform:junit-platform-launcher:1.5.2')
to the dependencies section in build.gradle file, refresh gradle (on eclipse, on the context menu of the project > Gradle > Refresh Gradle Project). You should be able to run tests one by one.
Happy coding

JPA class not found on production system

I am using eclipse mars and seem to be able to use JPA in a stand alone app (no glassfish/jboss) by just using these libraries:
eclipselink.jar
javax.persistence_2.1.0.v201304241213.jar
org.eclipse.persistence.jpa.jpql_2.5.2.v20140319-9ad6abd.jar
But when I build and deploy my app I keep getting the below errors. Would my version of java matter? I'm using 1.6.0 24 32 bit on my production board and my IDE is a 64 bit system. The above libraries were included when I created a test project in NetBeans so I was able to use JPA in NetBeans fine as well. Am I missing additional libraries or perhaps something is wrong with my deployment? any advise is greatly appreciated.
java.lang.RuntimeException: java.lang.NoClassDefFoundError: javax/persistence/NoResultException
at com.s3.utils.ExceptionCatchingSwingWorker$1.done(ExceptionCatchingSwingWorker.java:79)
at javax.swing.SwingWorker$5.run(Unknown Source)
at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(Unknown Source)
at sun.swing.AccumulativeRunnable.run(Unknown Source)
at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source)
at javax.swing.Timer.fireActionPerformed(Unknown Source)
at javax.swing.Timer$DoPostEvent.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at com.s3.gui.control.TracingEventQueue.dispatchEvent(TracingEventQueue.java:30)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: javax/persistence/NoResultException
at com.s3.gui.pages.usermanagement.ImportFromUSBActionListener.doInstall(ImportFromUSBActionListener.java:116)

Chrome is failing to launch with Selenium 2.53.0 and Chrome driver 2.25

While I am trying to verify any test cases on chrome, it fails. The Chrome is launching but after that it is showing out of memory. As per chrome help page, I disabled all the chrome extensions and closed all the table also. Still facing the same problem. The test cases are going fine on firefox and IE Please check screen shot
Getting following exception from selenium: when using selenium 2.53.1
Starting ChromeDriver 2.25.426923 (0390b88869384d6eb0d5d09729679f934aab9eed) on port 15091
Only local connections are allowed.
[2.164][SEVERE]: Unable to receive message from renderer
Code:
System.setProperty("webdriver.chrome.driver","C:\\TestWorkspace\\Resources\\chromedriver.exe");
WebDriver driver=new ChromeDriver();
driver.get("https://www.google.co.in/");
driver.manage().window().maximize();
Thread.sleep(500);
driver.quit();
When I am trying with updated selenium version 3.0.1 getting following error:In this case chrome not even opening itself
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/openqa/selenium/WebDriver : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

IBM HeapAnalyzer wont open

I downloaded IBM Support Assistance Workbench, Installed HeapAnalyzer 4.5.4. When I try and start the HeapAnalyzer tool I get this error:
Cannot Launch HeapAnalyzer - Could not find the main class: com.ibm.jinwoo.heap.HeapAnalyzer
Today 8:22 AM | Tags: heapanalyzer, installation, run
Unanswered question This question has not been answered yet.
I cannot seem to launch HeapAnalyzer
C:\Software\IBMHeapAnalyzer>java -Xmx1g -jar ha454.jar
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/ibm/jinwoo/heap/HeapAnalyzer : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: com.ibm.jinwoo.heap.HeapAnalyzer. Program will exit.
Has anyone else experienced this and know how to fix it?
type java --version does the version agree with 51.0
refer to stackoverflow.com/questions/10382929/…
you may need to install the latest jdk, or you can export the JAVA_HOME for the IBM JDK and add $JAVA_HOME/bin to your path

Could not find main class : Program will exit

I was messing with the JRE setup on Eclipse. Originally the project was set to 1.6 and when set to 1.7, my program started showing a lot of errors. So when i switched back to 1.6, all the compile time errors vanished but i have a new problem now.
This was shown on the console when i tried to run the started class containing the main function. The .class files all exist. Please advice.
java.lang.UnsupportedClassVersionError: Demo : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Exception in thread "main"
Version 51.0 means the are still class files compiled with Java 7. This files wont run with a JRE 6. You have to recompile them first (Rebuild project or clean compile using ant/maven).
Check if java versions match in your Java Build path and Java Compiler in Project properties. I think you compiled with 1.6 and is trying to run with java 1.7