Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ - Access is denied when building Artifacts

I'm trying to export my JavaFX 2 application using IntelliJ 13.1.2 on Windows 8 x64. This is my setup:

enter image description here

But when I build the artifact I get an error, this is the log:

Information:Compilation completed with 1 error and 0 warnings in 7 sec

Information:1 error

Information:0 warnings

Error:Java FX Packager: D:\Dropbox\Development\MultiWork-PC\out\artifacts\MultiWork_PC (Access is denied)

I don't know if it is a bug or more probably some problem with Windows permission. All the files are copied in the Artifact output folder:

enter image description here

Except the app itself! What I have tried:

  1. Running IntelliJ as Administrator
  2. Changing folder permission so everyone can write/modify it
  3. Changing folder location from D:\, to C:\, Desktop and Documents but still getting the error

NOTE: this doesn't happen if I deploy a jar instead of a JavaFX Application

like image 786
Andres Avatar asked Sep 17 '14 02:09

Andres


2 Answers

I ended up using Maven to export my JavaFX app:

    <plugin>
        <groupId>com.zenjava</groupId>
        <artifactId>javafx-maven-plugin</artifactId>
        <version>8.1.1</version>
        <configuration>
            <mainClass>foo.bar.mainclass</mainClass>
        </configuration>
    </plugin>

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.5.1</version>
        <configuration>
            <source>1.8</source>
            <target>1.8</target>
        </configuration>
    </plugin>

</plugins>

To clean and build run:

clean jfx:jar

In your /target/jfx/app you will find your executable JavaFX jar file with a lib folder containing all the dependencies.

like image 55
Andres Avatar answered Sep 30 '22 00:09

Andres


I had the same problem. I kind of solved it:

  • by ticking the "Build on make" box in the Project Structur Dialog
  • starting a Run of my Java App in Intellij Idea

Now the executable jar magically appeared in my build folder. God knows why.

like image 20
stef Avatar answered Sep 29 '22 23:09

stef