I have problems with running the code in rhapsody and my error message is:
"
Building ------------ MainDefaultComponent.class ------------
Executing: "C:\Users\olle\IBM\Rational\Rhapsody\7.5.3\Share\etc\jdkmake.bat" DefaultComponent.bat build
Unable to compile
Build Done
"
Do anybody know how to make my program to successfully compile?
The error is because Rhapsody can't find a java compiler. If you want to generate Java code using Rhapsody you need a JDK installed before you install Rhapsody, not just the JRE.
What JDK did you have installed before you installed Rhapsody, and where did you tell the Rhapsody installer it was located?
Your rhapsody.ini file (C:\Users\olle\IBM\Rational\Rhapsody\7.5.3\rhapsody.ini)will contain a line starting JavaLocation=. This needs to match your JDK directory, e.g. C:\Program Files\Java\jdk1.6.0_24
This value is also hard-coded into jdkmake.bat; you can see this if you open it up in a text editor. So if you update your JDK after installing Rhapsody the build script doesn't pick up the path to the newly installed java compiler, javac.
Putting the path to your javac into jdkmake.bat lines 2 and 3 will fix the issue. Note that you'll need to use 8.3 filename style if there are spaces in the path to your javac.
I got similar errors installing rational rhapsody developer and then installing stuff like MingW, Visual C++ , etc.. the easiest way for me was to do in "control Panel->Software->Rhapsody->Change -> Repair/reinstall" rhapsody after it, so all internal necessary settings were performed by rhapsody itself. hope this helps.
Related
In Intellij IDEA, when I run a java file in the terminal or run a jar artifact, I get this error:
I have an up to date jdk and runtime enviroment installed on my computer, and I only have one runtime environment installed. Also, I do not have an issue with the actual compilation of the program, just the
"$java Program" command.
The error message is clear: You compiled the Java source with an newer Java version than your are using to execute it.
So your assumption that you have only one Java version installed cannot be correct. Are you aware that the IDE itself comes with a Java runtime?
Next time please post text as text, not a link to an image.
I'm trying to setup Unity to build for Android. But I can't get the Java Development Kit. Can't download it and can't find it either.
In this answer, the guy says
To ensure JDK is installed, just go through the following :
press Win + R
type 'cmd' in the popup and press button OK.
in the console which has opened, type javac -version and press enter.
You should see as an output :
javac 1.8.0_XX
If so SDK is installed.
I did that and I got "javac 1.8.0_XX", and so I assumed I had the JDK, so I went to Unity > External Tools > JDK and tried linking the following path: "C:\Program Files\Java\jre1.8.0", and got the error message: "The path you specified does not look like a valid JDK installation. Android development requires at least JDK(1.7), having JRE only is not enough. Please make sure you are selecting a suitable JDK home directory or download and install the latest JDK: link"
I clicked the download link for windows x64 and it never loads and eventually says there's no connection. I tried the x86 as well.
In this SO question How do I find where JDK is installed on my windows machine?
Answer: For windows, in the command prompt:
c:\> for %i in (java.exe) do #echo. %~$PATH:i
And so I did that and got the path "C:\ProgramData\Oracle\Java\javapath\java.exe"
When I try linking via Unity > External tools > JDK it doesn't find any files.
I'm a bit clueless now.
#RealAnyOne, you have installed Java with JRE only installation i.e., without out a JDK that’s what you see only one folder and this is why it also showing version in the command line since it won’t check for JDK. JRE is Java Runtime Environment, JDK is Java Development Kit which contains many essential libraries. So Ideally there should be two folders JRE and JDK. This is the reason you are getting this issue with Unity.
To Fix::
Uninstall old Java 8
Download Java 8 from the oracle website
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Install it. Now you should have two folders. Then point your Unity to it.
I got tired of using Eclipse because it was too "plain" and "old style". So I moved on to a program called Sublime Text 3 and I used a package named "material theme" which made the program look flat and all nice and stuff.
But I wanted to code Java in that but I don't know how to compile stuff without using an IDE and it was not easy to find out but I found out that you could do it through the terminal/cmd of your operating system.
But what I don't understand is how I could actually use the javac command which means Java Compile and I searched and I didn't find out because I couldn't understand anything that was posted on either YouTube or Stack Overflow because I'm new to this whole terminal/cmd Java Compiling thing.
You're almost there buddy!
Just be sure you have the Java Development Kit (JDK) installed in your system. The JDK provides you the command javac -which you need to compile your .java program files.
The javac command is not that friendly as you think it is. You have to let it know where to find the java file you want to compile.
For example you saved Main.java inside C:\Projects\Java you must compile it this way javac C:\Projects\Java\Main.java.
Then you can run your program this way too java C:\Projects\Java\Main
As mentioned here... You can find a more detailed explanation to the official tutorial.
You need to install java JDK which you can find here
Then you need to right-click on my computer->properties->advanced system settings->Environment variables -> Click on path -> New
Then add the path to the bin folder inside the install folder for JDK.
Then in cmd you can compile with
javac *.java
inside the directory of your code
Install JDK
(Make sure your PATH variable is set up)
Use SublimeText's Build System, which allows you to compile open java documents with the Ctrl + B command.
You did not install JDK. You need to install JDK which has javac command.
Installing JDK on MAC instructions
Installing JDK on Windows instructions
After installing JDK(Java Development Kit), you can run the command javac -version on command line and let it show the version that is installed.
I downloaded the 64 bit JDK from the oracle site (Win7 64bit) and installed it with the install wizard. The instalation folder went in Program file. When I copy the link for the PATH variable and edit it the way it is shown everywhere, it doesn't work. When I check in CMD "java-version" it always says:
The java version is not recognized as an internal or external command.
Any ideas what is wrong?
I edited this PATH variable so many times and it never worked.
You should type java -version, not java-version.
Let's make the long story short. Here is what happened:
IntelliJ 12 CE downloaded and installed
Latest Java 1.7/1.8 downloaded and installed
JDK was setup to make and run the project
I faced the following strange error:
Error: java: System Java Compiler was not found in classpath
This was despite of the fact that I had Java 1.7/1.8 fully installed and had no problems working with it through the terminal.
The solution that fixed my problem was as follows:
In:
Project Settings > Compiler > Java Compiler
I changed the drop down Use compiler from Javac to Eclipse!
Non of the other solutions I found on the web was helpful. Hope this helps you my unknown fellow reader.
IMPORTANT: THIS HAD NOTHING TO DO WITH MY JAVA_HOME AS IT WAS SET CORRECTLY.
You need to set environment variable JAVA_HOME. The IDE will check that variable on startup.
And enter the path to the home dir of installed JDK. Once it started it should point to the JDK used to run IDE. In this case the new compiler will be available among compilers already configured. You can always configure any new compiler using IDE compiler settings.
i found that if you install vscode java plugin in your mac , IDEA will not work correctly.
so disable the java plugins in vscode.
Every thing gonna be alright