Can't find or load main class to make a Javafx jar in IntelliJ IDEA - windows-10

I made my first Javafx Application in IntellIJ IDEA it runs perfectly but i have a problem.
I can't make an executable jar for this Application.
To be more explicit whenever i try to search for the main class i can't find it in the artifact tab.
I tried making a normal jar (in the artifacts menu they give you the choice between normal jar and javafx application jar) and the main is detected.

It's a known issue. You can type the fully qualified class name manually as the workaround (foo.bar.MyClass).

Related

Domino 9 Update site osgi class not found

I'm trying to use an Updatesite.nsf to deploy jar to a test server. I can see it in this case the jdbc driver plugin at the server console using the http osgi ss command. But when I use it I get a java.lang.ClassNotFoundException com.mysql.jdbc.driver. What I'm missing or doing wrong. Thank you
The immediate answer is that the code that's calling Class.forName will need to have the MySQL driver in its classloader one way or another, which an XPage or in-NSF Java won't have by default.
To expand on it a bit:
If you're trying to call it from an XPage or Java code in an NSF, it would have to be part of an XPages Library from another plugin, which in turn depends on and re-exports the driver plugin.
If you're trying to call it from another plugin, that other plugin should have a Require-Bundle or Import-Package entry to bring it in.
The class will be available to NSFs by default if you plunk it in jvm/lib/ext, though that admittedly gives up the niceties of OSGi-based deployment.
The reason it works for the XPages JDBC support is that the wrapped plugins created by the wizard in Designer include a special extension point to provide the driver class to the ExtLib code that wants it, but they don't make it automatically available to XPages apps themselves.

Can't reload certain classes in jrebel

I am using JRebel + Intellij JRebel IDE Plugin to hot deploy a gradle project.
I have a situation with JRebel where there are certain Java classes that JRebel refuses to allow me to hot-deploy.
Some classes reload fine.
Other classes do not reload at all. (often in the same gradle sub-project as classes that reload OK)
There is no rhyme or reason to why they do not want to reload. The classes are not really anything special. Not insanely long.
We use Guice... but some files that are managed by Guice reload fine while others do not.
It is making JRebel pretty much unusable because you can't trust whether it will hot deploy or not.
I created a custom JRebel plugin for our project hoping it would help but it did not. Because the class itself will not trigger a reload event, the plugin fails to help fix this.
Note the class in question that will not reload is often an implementation of an interface where if I change the implementation, no reload happens. But if I change the interface java class, that will reload fine!
There is something that JRebel in particular does not like about the Java class files.
When I build the files that it won't pick up, you can even see in the IDE and 100% of the time for these files I get:
Any have any ideas of a way to get this to stop happening?
The class was not in the classloader yet due to lazy loading. Thus the issue.
JRebel can't reload classes not yet in the classloader.

Loading resources in a plug-in works in eclipse but not for maven

I am trying to load resources with the platform URL approach in an e4 RCP application.
This works fine for my application plug-in. But I have got a second plug-in which extends the application via fragments. In this plug-in this approach
platform:/plugin/<name>/<path>
does not work. If I start the project from eclipse though, the resources can be loaded.
What could I be doing wrong?
The build.properties content of the plug-in is as follows:
source.. = src
bin.includes = META-INF/,\
.,\
plugin.xml,\
fragment.e4xmi,\
res/
The problem was:
The Maven build is case sensitive for file names, while eclipse is not.
new URL("platform:/plugin/name/res/myfile.txt")
new URL("platform:/plugin/name/res/myFile.txt")
In eclipse, both versions are working; from maven build, only the second version.
This seems quite strange to me. It would be great if anyone could explain this.

Groovy class files not included in deployment

I have two java projects, A and B, A depends on B. In project B I've added a groovy class (Foo.groovy) and a java class (Bar.java) that uses the groovy class. In MyEclipse, Foo.class is in bin-groovy, and I can run things from MyEclipse just fine. However, when MyEclipse deploys project A to tomcat, it does not include the Foo.class file so Bar.java can't run. If I manually copy Foo.class to tomcat, it works just fine. Is this just a MyEclipse issue? It's driving me crazy because all that needs to happen is to have the .class files from the groovy classes get included on a deploy, it seems like that should be an easy configuration, but I have not found a solution for this yet.
Where are the missing files in the source structure? Are they in grails-app or src/groovy?
When you deploy via CL what happens (i.e. grails war or similar command)

Java ME bundle Microlog jars with my midlet jar

I'm pretty new to Java ME and i'm trying to use Microlog to handle logging in my midlet.
In eclipse i can reference Microlog jars and it's all good in dev time,
but when i try to launch the application the jars aren't found on the device.
How can i bundle those referenced libs into my midlet?
Someone have any experience with using Microlog in a midlet?
Thanks.
The classes are not found, because they are not inside the final MIDlet suite you are trying to run run in the device. In fact, you can't add external jars directly inside your midlet jar file as J2ME class loader is much more simple than the one in desktop Java. It only loads the classes found inside the midlet jar.
So, you have to extract everything from the Microlog jar and put them into you midlet jar just like you put your own classes and other resources. Probably you can configure your build tool to do this automatically for you.
Eclipse is able to find the classes because you have added the jar into your project's classpath.
Just a little addition. If you are using Eclipse to export the midlet you are able to generate the jar-file including all the classes of the dependencies for you.
Select "Java Build Path" of your project and then "Order and Export". Make sure the microlog jar-files are checked in that list. This will bundle everything into one jar-file.
Hope this helps.
I would recommend to use ProGuard to reduce the size of the final jar. Please read this article to figure out how to do it with Microlog:
http://myossdevblog.blogspot.com/2009/06/using-proguard-to-shrink-microlog.html

Resources