#Trying to run a java file

1 messages ยท Page 1 of 1 (latest)

open rockBOT
#

<@&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>.

#

To run a Java file, you need to execute it using the Java Virtual Machine (JVM). Here's how you can run a Java file from the command line:

  1. Open a terminal or command prompt.

  2. Navigate to the directory where your Java file is located using the cd command. For example, if your file is in the "Documents" folder, you can use cd Documents to navigate to that folder.

  3. Once you are in the correct directory, use the following command to run your Java file:

    java -jar filename.jar
    

    Replace filename.jar with the actual name of your JAR file.

If you're still unable to run the JAR file, make sure that you have Java Development Kit (JDK) installed on your system and that it is added to your system's PATH variable.

Note: The "unluac" JAR file might not be intended for direct execution but rather as a library for other Java programs. Make sure you have a clear understanding of how to use it before proceeding further.

late talon
#

I tried this, I get an error saying "Unable to access jarfile"

vast hedge
#

which version of Java do you have installed, and did you add .jar? Try wrapping your path in "

late talon
#

I think its Version 8

#

I have tryped .jar at the end

#

What do you mean by wrapping your path in?

vast hedge
#

java -jar C:\Path with spaces\someFile.jar vs java -jar "C:\Path with spaces\someFile.jar"

#

And I'd upgrade to 21

open rockBOT
#

Download latest Java from https://adoptium.net/, run the installer.

Open a CMD and type java -version and javac -version, if both show your new Java version, you have successfully installed Java! ๐ŸŽ‰
https://i.imgur.com/CurMujt.png

In order to prevent issues with old installations you may want to remove them. Type where java and where javac. They should only show the new and no old entries:
https://i.imgur.com/x5k1GxG.png

If that is not the case, you may want to clean up. Therefore, type "environment variable" into the Windows search and follow the dialog. You will see two entries for a variable called Path, one for your user and one for the system. This variable tells Windows where to look for commands, like java and javac.
https://i.imgur.com/3bN9QE2.png

Edit both. Make sure that they only list the entry to your new Java installation and remove all the old entries you have seen with the where command before:
https://i.imgur.com/JAYog1U.png

Confirm and close all dialogs. Restart your CMD window and try where java and where javac again. It should only list the new installation now and nothing else.

Congratulation, your Java is now finally ready, happy coding ๐ŸŽ‰

Eclipse Adoptium provides prebuilt OpenJDK binaries ...

crystal remnant
late talon
#

I have used it wrong but I am a still a little confused on how to use it

#

Here is an example usage of unluac:
java -jar unluac.jar myfile.lua > myfile_decompiled.lua

crystal remnant
#

where did you get the jar from? theres probably instructions

vast hedge
#

you're executing a jar file, passing in your file as input, and outputting it to the decompiled file

late talon
#
crystal remnant
#

where is the jar?

late talon
#

Okay i see

vast hedge
#

in your terminal, are you in the folder where the files are?

#

that's why I used the absolute path

late talon
#

the jar file that is "unlac" is in C:\DUMP

crystal remnant
#

so you'd need to use that when specifying the jar

late talon
#

I see

#

Can you give me an example? Im not sure which order i should type it in

crystal remnant
#

when you specify the file name

#

so instead of unlac.jar, you would put C:\DUMP\unlac.jar

vast hedge
#

well there are 2 options

late talon
#

I see

crystal remnant
#

could also cd to the directory the file is in

vast hedge
#

you can use the fully qualified path like java -jar "C:\Path with spaces\someFile.jar" or you can use CD so you're in the DUMP folder and then you can do the normal version

late talon
#

Am i doing something wrong here?

rotund thunder
#

does that exist ?

late talon
#

yes

rotund thunder
#

either the file is in use by another process or its a bust jar

#

also just for the sake of checking things, in your topic your name is different then on the command

#

u got unlac

#

@late talon

late talon
#

sorry

#

the file is called unlac yes

vast hedge
#

can you do ls -lrt

late talon
vast hedge
#

ah I guess no WSL, my bad. Can you do dir

late talon
vast hedge
#

is that the folder you're running it from? I don't see the jar file

late talon
vast hedge
#

yes but where you ran the dir command didn't

#

so in DUMP also place the other two files

late talon
#

which files

vast hedge
#

the lua file

#

then in your console cd to the dump folder

brittle sail
#

Or just type "cmd" in the folder bar

late talon
#

Okay i see

crystal remnant
#

you could also just specify the path of the files, if you dont want to move them

brittle sail
late talon
brittle sail
#

U misspelled the file name

#

It's unluac

late talon
#

ah

crystal remnant
brittle sail
# late talon

That is a custom exception, for this u have to write the devs of that jar or either search for a solution online

crystal remnant
# late talon

its saying the file you passed in isn't a lua file, based on the file signature

brittle sail
#

Probably it's because it doesn't recognize .lua as a lua file

#

Nah probably because of it's content

late talon
#

bruh

#

itss alright

#

Im just trying to decode a lua file

#

and someone told me that the lua decoder thing would work

brittle sail
#

Maybe that file has been compiled by a newer version of lua the ones supported by the jar

crystal remnant
#

it's a decompiler. you probably need a luac file, not a lua file

brittle sail
#

That too

late talon
#

ah its okay

#

thank you guys for trying to help

#

do you guys know if theres anyway to actually be able to read this file or is there no way

vast hedge
#

are you certain you have the right version?

brittle sail
late talon
late talon
vast hedge
#

the tool, there are different lua versions. it's what's mentioned in the main answer

late talon
#

I have no idea

#

somebody just told me to use that tool

vast hedge
late talon
#

Sure

#

How do i run it?

#

how do i know which version lua it is?

vast hedge
#

hex decoder

late talon
#

okay that works