#JVM "A Java Exception occured"

1 messages · Page 1 of 1 (latest)

ashen arch
#

Hey, I currently am writing an application that creates a MySQL database and then fills it with data. When I run it on Intellij or the Terminal, it doesn't have any issues, but when running the jar file normally, it shows me that error and I don't know how to fix it. Do you have an idea?

wide zodiacBOT
#

<@&987246399047479336> please have a look, thanks.

#

Here is an AI assisted attempt to answer your question 🤖. Maybe it helps! In any case, a human is on the way 👍. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.

#
TJ-Bot
Hey, I currently am writing an application that creates a MySQL database and then fills it with data. When I run it on Intellij or the Terminal, it doesn't have any issues, but when running the jar file normally, it shows me that error and I don't know how

es. However, when I try to run it on a different machine, I get the error message "A Java Exception occurred". Can anyone help me understand what might be causing this issue?

This error message typically indicates that there is a problem with the Java Virtual Machine (JVM) on the machine where you are trying to run your application. There could be a number of reasons for this error, such as:

  1. The JVM version on the other machine may be incompatible with your application. Make sure that the JVM version installed on the other machine is compatible with the version of Java you are using to develop your application.

  2. There may be missing or corrupted Java runtime files on the other machine. Try reinstalling Java on that machine to see if that resolves the issue.

  3. It is also possible that there is a problem with the classpath or environment variables on the other machine that is preventing your application from running correctly.

  4. Check if there are any specific dependencies or configurations required for your application to run properly on different machines.

By investigating these possible causes, you should be able to identify and resolve the issue causing the "A Java Exception occurred" error message when running your application on a different machine.

cedar grove
ashen arch
#

No, the Windows 11 Terminal.

cedar grove
#

try using your OS's shell, such as the Command Prompt or PowerShell on Windows

#

hmm

#

so changes are, the file association for your jar isnt proper, if it's only occuring when double clicking the jar

#

when running in terminal, its using what is on your path

ashen arch
#

It only happens then, yeah.

#

Even when I move the jar to a different folder.

cedar grove
#

but when double clicking, it uses the file association (what you select when "Open With" pops up)

ashen arch
#

What should I set so it runs properly?

cedar grove
#

try right clicking the jar, choosing "Open With", then select the java version you used to compile

ashen arch
#

Ok, there are jdk1.8.0_201, jdk-21, jre1.8

cedar grove
#

did you compile with jdk 21?

ashen arch
#

I think so, where can I check it again?

cedar grove
#

which version is your IDE using?

ashen arch
#

IntelliJ IDEA 2023.2.6 Community Edition

cedar grove
#

check project structure

wide zodiacBOT
#

@ashen arch

Your question has been closed due to inactivity.

If it was not resolved yet, feel free to just post a message below
to reopen it, or create a new thread.

Note that usually the reason for nobody calling back is that your
question may have been not well asked and hence no one felt confident
enough answering.

When you reopen the thread, try to use your time to improve the quality
of the question by elaborating, providing details, context, all relevant code
snippets, any errors you are getting, concrete examples and perhaps also some
screenshots. Share your attempt, explain the expected results and compare
them to the current results.

Also try to make the information easily accessible by sharing code
or assignment descriptions directly on Discord, not behind a link or
PDF-file; provide some guidance for long code snippets and ensure
the code is well formatted and has syntax highlighting. Kindly read through
https://stackoverflow.com/help/how-to-ask for more.

With enough info, someone knows the answer for sure 👍