JAVAFX non-latin character - java-8

I'm build a javafx installer with inno setup and link ".test" files to my soft.
but if i create a file,if the file name with non-Latin characters(中国.test) will cause JVM exception.
i don't know why?
double click the file "中国.test":
after click ok:
my environment:
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b15, mixed mode)
Thanks!

Related

wrong java version in heroku

I've created a spring boot app and would like to run it on heroku.
My app is compiled using java 9.
As I'm deploying it to heroku using the CLI plugin I'm getting
Exception in thread "main" java.lang.UnsupportedClassVersionError: io/safeblocks/firewall/FirewallApplication has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
Clearly this means java versions mismatch. I added the system.properties file to my resources folder with the property java.runtime.version=9 as explained but still getting the same error.
As I run the command heroku run java -version --app myApp I'm getting:
openjdk version "1.8.0_171-heroku"
OpenJDK Runtime Environment (build 1.8.0_171-heroku-b11)
OpenJDK 64-Bit Server VM (build 25.171-b11, mixed mode)
So it seems heroku is still not picking up the required java version.
Any ideas?
I see you added the system.properties file to your resources folder, I did the same mistake. The file system.properties must be placed under the root folder of your project.
The content of your file is correct:
java.runtime.version=9
After you moved the file to the root folder, commit your changes and do:
git push heroku master
Everything should be fine then.

How to add enable flag for Flight Recorder in Maven project?

I'm just about start using Java Mission Control 5.3.0.
I have added -XX:+UnlockCommercialFeatures -XX:+FlightRecorder into my web-app's jetty.template.
Then I start the web-app with mvn jetty:run.
But while I was starting Flight Recorder I got the problem occurred pop-up as below.
'Start Flight Recording.. (Last attempt failed)' have encountered a problem.Commercial features are not enabled. In JDK7u4 and above,the JVM must be started with -XX:+UnlockCommercialFeatures -XX:+FlightRecorder .
And I also try adding the flags as below into pom.xml but it doesn't work.
<jvmArgs>
<jvmArg>-Xmx128m</jvmArg>
<jvmArg>-Xms128m</jvmArg>
<jvmArg>-XX:MaxPermSize=512m</jvmArg>
<jvmArg>-XX:+UnlockCommercialFeatures</jvmArg>
<jvmArg>-XX:+FlightRecorder</jvmArg>
<jvmArg>-XX:StartFlightRecording=duration=160s,delay=20s,settings=profile,filename=target/recording.jfr</jvmArg>
</jvmArgs>
What should I do for enable Flight Recorder on my web-app?
That configuration should be added to the running VM of Jetty so I'd try this:
mvn jetty:run -XX:+UnlockCommercialFeatures -XX:+FlightRecorder
I could not test this, and I work most on Tomcat, but I think this could help you
I got the answer by using below.
export MAVEN_OPTS="$MAVEN_OPTS -XX:+UnlockCommercialFeatures -XX:+FlightRecorder"
If you are using jcmd command from jdk, then could enable JFR via:
jcmd 31118 VM.unlock_commercial_features
Then use JFR.
e.g
jcmd 31118 JFR.start name=a
After some tests, I'll add something that could help someone else :
This is the JVM (Azul Zulu) I am using for my tests :
openjdk version "1.8.0_272"
OpenJDK Runtime Environment (Zulu 8.50.0.21-CA-linux64) (build 1.8.0_272-b17)
OpenJDK 64-Bit Server VM (Zulu 8.50.0.21-CA-linux64) (build 25.272-b17, mixed mode)
I created in the top of the project a file :
.mvn/jvm.config
That contains only one instruction :
-XX:StartFlightRecording=filename=build.jfr
Then, do whatever mvn goal you want to do and look for the build.jfr command you want.
Zulu's JVM has flight record enabled by default, so you this is one step less to worry.
It is important to mention that, in my case I had several JVM's installed in my machine and the mvn command uses JAVA_HOME variable, so make sure it is pointing to the right jvm.

Import SpringSource into IDEA.But had a error "Unrecognized VM option 'MaxMetaspaceSize=1024m'"

I want to import Spring-framework into IDEA.
I followed the document, and run the following command, but I had a error:
spring-framework>gradlew.bat :spring-oxm:compileTestJava cleanIdea idea
Unrecognized VM option 'MaxMetaspaceSize=1024m'
Could not create the Java virtual machine.
What's wrong?
My OS is Win7. JDK version is as following :
>java -version
java version "1.6.0_38"
Java(TM) SE Runtime Environment (build 1.6.0_38-b05)
Java HotSpot(TM) Client VM (build 20.13-b02, mixed mode, sharing)
>javac -version
javac 1.6.0_38
As #VMN said, MaxMetaspaceSize is supported in Java 8 and have bugs.
You can try one of this:
1)Download JDK8 and set it to you environment.
2)Edit gradlew.bat(windows) or gradlew(linux), remove the VM option MaxMetaspaceSize.
I had the same error. Cause of error is in Java 8 option "MaxMetaspaceSize=1024m", that not supported in early versions. Spring developers use this option in master branch.
After switching to the 3.2.x branch project was successfully imported.
You have three choice to slove this problem
1)use JDK8 as your enviroment;
2)ignore or delete "set GRADLE_OPTS=-XX:MaxMetaspaceSize=1024m -Xmx1024m -XX:MaxHeapSize=256m %GRADLE_OPTS%" in gradle.bat;
3)choose another branch like 3.2.x

How to upgrade to java 1.6 from java 1.5 in Oracle Application Server

Interested in upgrading JAVA VERSION from JAVA 1.5 to JAVA 1.6
[oracle#server301 /]$ java -version
java version "1.5.0_12"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
Java HotSpot(TM) Server VM (build 1.5.0_12-b04, mixed mode)
also interested in knowing Oracle Application Server VERSION (from command line )
First - you need to install java 1.6
If you want to change it for the whole OAS then alias java to your new java directory (1.6).
If you want to change it for a specific OC4J, then:
Open opmn/conf/opmn.xml
find the element which represend your OC4J
update the value in the element: process-type/module-data/category/data where id="java-bin", to your new java path
restart OAS

Difficulty when configuring JUnit in Windows 7 Home Premium

i need help to install Junit in my computer, so I can create unit tests to run in JMeter.
The problem is that when I try to test if the JUnit installation is correct, it gives the following message:
"Error: Could not find or load main class org.junit.runner.JUnitCore"
Here are the configurations of the variables:
Environment variables
JAVA_HOME = C:\Program Files\Java\jdk1.7.0_03
JUNIT_HOME = C:\junit
in Path = %JAVA_HOME%\bin;%JUNIT_HOME%\junit-4.10.jar
Tests in cmd:
C:\Users\luis.ribeiro>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.7.0_03
C:\Users\luis.ribeiro>echo %JUNIT_HOME%
C:\junit
C:\Users\luis.ribeiro>java -version
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b05)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)
C:\Users\luis.ribeiro>java org.junit.runner.JUnitCore org.junit.tests.AllTests
Error: Could not find or load main class org.junit.runner.JUnitCore
Could someone help me with this problem please.
I will be very thank full,
With the best regards,
Luis
You need to add junit to the CLASSPATH, not the PATH.
Example from the FAQ:
set CLASSPATH=%JUNIT_HOME%\junit.jar;c:\myproject\classes;c:\myproject\lib\something.jar

Resources