Jump to content

Help - Compile .java classes to .jar [Intellij]


Recommended Posts

Posted (edited)

So I'm trying to compile my classes using intellij's artifacts. However, when I go to Project Settings > Artifacts > Jar > From modules to dependencies  > Main Class > *MY CLASS*.

I get an error saying:

I0XZBTR.png

Never actually had the need to export to .jar, so I'm pretty much in the blank.

Edited by Visty
Posted
30 minutes ago, Visty said:

So I'm trying to compile my classes using intellij's artifacts. However, when I go to Project Settings > Artifacts > Jar > From modules to dependencies  > Main Class > *MY CLASS*.

I get an error saying:

I0XZBTR.png

Never actually had the need to export to .jar, so I'm pretty much in the blank.

Just ignore that warning and press OK. Your jar will function fine.

Posted (edited)
1 hour ago, Visty said:

So I'm trying to compile my classes using intellij's artifacts. However, when I go to Project Settings > Artifacts > Jar > From modules to dependencies  > Main Class > *MY CLASS*.

I get an error saying:

I0XZBTR.png

Never actually had the need to export to .jar, so I'm pretty much in the blank.

 

1 hour ago, HeyImJamie said:

Download Eclipse, Link folder - .Jar w/ that. I had to create an individual project each time to .Jar w/ IntelliJ

 

Here is how to do it:

1. Open module settings (F4), or right click on a module and select open module settings

2. Navigate to the artifacts tab on the left

IMGhbo7.png

3. Click the green + symbol and select JAR -> Empty

6hgzpgZ.png

4. Move the compiled output of the module you want to put into the .jar from the available elements (on the right) into the .jar (on the left) by double clicking on it

AXO8BQg.png

 

5. Set the name of your .jar, and change the output directory to the scripts folder:

JLTiUqt.png

 

6. Select apply.

7. To then build your script, in the navbar select Build -> Build Artifacts... -> Select the artifact you want to build

Edited by Explv
  • Like 3
Posted (edited)
2 minutes ago, Visty said:

Doesn't this compile all the scripts in the packages inside Intellij into the .jar file? :o

No, it will only include what you tell it to include.

If you make each of your scripts it's own module, then you can include each individual module in a different .jar

Notice how I have one .jar for my AIO script and another for my walking script.

Edited by Explv

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...