I just can't seem to find the .class files for my Groovy source code in IntelliJ IDEA Grails projekt. I've created a grails app "qotd" and a plugin "selenium" which is kind of a grails app itself, as you might know. So just to keep things tidy here's a screenshot of my Grails View:
Grails View
As you can see I have source code for both Java and Groovy. Both share the same package "de.it2m.testcases". Could this be a problem? Anyway, now I need to know where the .class files are stored. I've compiled both the "qotd" app and its "selenium" plugin using the "grails run-app" command without errors, so I'm sure there must be the .class files somewhere. I already found the class file for the "SeGridTest.java" class in:
...IntelliJ workspace\qotd\out\production\selenium-inplacePlugin\de\it2m\testcases
Unfortunately the "SeleniumTest.class" is missing in this directory (as I would have expected it there). I was browsing the ".grails" directory as well but without any success.
Where could the SeleniumTest.class hide...?
Note: I'm working on Windows 8.1 Pro, IntelliJ ultimate 13.1.4 and Grails 2.3.8
#Tinku Saini
Thanks for your help! The .class files get into the "target" directory
Related
I built a javaFX artifact using IntelliJ. My first problem was in the Application Class box, where it didn't automatically detect my main class, or even suggest any classes as main class when I searched in the search box. I saw that it was a bug with IntelliJ, somewhere on StackOverflow, and I just manually entered my packageName.Main in the application class box.
I have two dependencies that I extracted into this output root. The output of building the artifact looks like this.
Then after rebuilding the project the JAR runs on my PC 100%, even if I move the JAR to another directory, it works 100%.
So I copied this JAR (Swansong.jar) to my other PC and when I double-clicked it, nothing happended. When I ran it in the cmd:
java -jar Swansong.jar I got this error:
Error: Could not find or load main class swansong.Main
Caused by: java.lang.ClassNotFoundException: swansong.Main
I read about manifest files but I can't find a manifest file anywhere in my project, but if I extract the JAR file the manifest file that was generated looks like this. Can anyone please help me, why does the JAR run on one PC but not on the other? And how can I fix this?
UPDATE:
This is the contents of my jar file and this is the contents of the swansong directory inside the jar file.
UPDATE 2:
I feel stupid. My main PC runs jdk8 and my other pc runs jdk11. And JavaFX is not included in the jdk11. So I think this is the problem, but not 100% sure yet. Will test and see. Are there any workarounds for this?
I hate to admit it, but the solution to the problem was staring me in the face all along, and I am truly embarrassed. I used Java 8 to develop the program. Target PC was using Java 11 and I never thought to check the JDK version, because I thought I was using JDK8 on both PCs.
JavaFX is included in JDK8, but not in JDK11. It should be added to a project as an external library when using newer JDK versions. I just used JDK8 for running the program and everything works 100%. Thanks for the answers and comments though, I learned a lot about manifests and classpaths trying to solve this problem, so the effort was not in vain!
Any executable jar file needs to have manifest file which points to the main class.
-JAR File
\---META-INF
\--MANIFEST.MF
In the MANIFEST.MF, you should introduce the main class as this:
Main-Class: com.mycompany.MainClass
Class-Path: .
com.mycompany.MainClass should be replaced with appropriate path (fully qualified name of your main class)
I have some problem to open the class inside my project libraries on Eclipse Luna. For the beginning I have .war file of my web apps, I imported that .war files to Eclipse Luna and I could open index.jps files and other files under Web Content folder. But when I'm tried to open the engine class file I got Source not found. This is the screenshot of the errors.
I'm new in Java code and with Eclipse. What's wrong with that errors and how to resolve that problems ? Please anybody knows could help me. Thanks before.
WAR files don't usually contain the Java source code, just the compiled class files which is what you are seeing.
If you have the Java source elsewhere you can use the 'Attach Source...' button shown in that screenshot to tell Eclipse about it.
As a newbie to programming, I am finding it really quite difficult to install all the necessary software and such to get everything running.
Up until now I have been using the command prompt and javac along with gedit to edit/compile my code, but we are meant to be using eclipse and then JUnit to test it.
I have just managed to get eclipse working, but still stuck as to how to get JUnit working.
I am stuck on the installation part...
The JUnit FAQ (http://junit.sourceforge.net/doc/faq/faq.htm#started_1) states...
Windows
To install JUnit on Windows, follow these steps:
Unzip the junit.zip distribution file to a directory referred to as %JUNIT_HOME%.
Add JUnit to the classpath:
set CLASSPATH=%CLASSPATH%;%JUNIT_HOME%\junit.jar
How can you "unzip" the "junit.zip distribution file" to the directory "%JUNIT_HOME%" and how do you add something to the classpath? Where is this class path? I tried extracting the zip folder and typing "%JUNIT_HOME%" into the directory, but it says the destination path is invalid, so I assume this is not what the instructions mean.
Apologies for the noob-questions... I'm finding this technical jargon difficult to find my way around.
Any hints for the next steps for installing JUnit will also be appreciated, as I will likely get stuck on those too.
If you are using Eclipse, please import the junit.jar file to your classpath in your project. You can do it by right+click on the project and choose Properties -> Java Build Path. and add you jar file.
I had configured the Jadeclipse plugin for viewing .class files, but it is still showing "source can't be found" in the particular JAR file.
Can anybody help me with this?
Have a look at JADClipse not working with Eclipse 3.6 for help. Also ensure that Path to decompiler is correct under Preferences in Java -> JadClipse.
I'm writing an application that makes use of Java's speech API and FreeTTS. The application works fine when I run it from the Netbeans IDE, but when I try to run it from a jar file on my local machine or on other machines, I get the following error:
"java.lang.NoClassDefFoundError: com/sun/speech/freetts/VoiceManager"
Is there any way for me to include the FreeTTS files in my jar file so it can run anywhere?
Any help would be greatly appreciated.
i had the same problem and i found this page:
http://ondra.zizka.cz/stranky/programovani/java/misc/freetts-line-unavailable-classcastexception-kevinvoicedirectory-error-opening-zipfile.texy
I did the easy way, which was to add the freetts installation to my dist folder, change the manifest of my jar on where to find the jsapi.jar, freetts.jar etc. and it is worked. I am just distributing freetts inside my folder.
The hard way is on the link above.